オープンソース・ソフトウェアの開発とダウンロード

Subversion リポジトリの参照

Annotation of /trunk/1.8.x/ccs-patch/specs/build-c6-2.6.32.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5625 - (hide annotations) (download) (as text)
Fri Nov 11 05:13:09 2011 UTC (12 years, 6 months ago) by kumaneko
File MIME type: text/x-sh
File size: 3638 byte(s)


1 kumaneko 4107 #! /bin/sh
2     #
3 kumaneko 5566 # This is a kernel build script for CentOS 6.1's 2.6.32 kernel.
4 kumaneko 4107 #
5    
6     die () {
7     echo $1
8     exit 1
9     }
10    
11     cd /tmp/ || die "Can't chdir to /tmp/ ."
12    
13 kumaneko 5566 if [ ! -r kernel-2.6.32-131.17.1.el6.src.rpm ]
14 kumaneko 4107 then
15 kumaneko 5566 wget http://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/kernel-2.6.32-131.17.1.el6.src.rpm || die "Can't download source package."
16 kumaneko 4107 fi
17 kumaneko 5566 rpm --checksig kernel-2.6.32-131.17.1.el6.src.rpm || die "Can't verify signature."
18     rpm -ivh kernel-2.6.32-131.17.1.el6.src.rpm || die "Can't install source package."
19     sed -i -e 's@--keyring \./kernel\.pub Red@--keyring ./kernel.pub CentOS@' -- /root/rpmbuild/SPECS/kernel.spec || die "Can't update spec file"
20     sed -i -e 's@Red Hat, Inc\.@CentOS@' -- /root/rpmbuild/SOURCES/genkey || die "Can't patch file"
21 kumaneko 4107
22     cd /root/rpmbuild/SOURCES/ || die "Can't chdir to /root/rpmbuild/SOURCES/ ."
23 kumaneko 5625 if [ ! -r ccs-patch-1.8.3-20111111.tar.gz ]
24 kumaneko 4107 then
25 kumaneko 5625 wget -O ccs-patch-1.8.3-20111111.tar.gz 'http://sourceforge.jp/frs/redir.php?f=/tomoyo/49684/ccs-patch-1.8.3-20111111.tar.gz' || die "Can't download patch."
26 kumaneko 4107 fi
27    
28     cd /root/rpmbuild/SPECS/ || die "Can't chdir to /root/rpmbuild/SPECS/ ."
29     cp -p kernel.spec ccs-kernel.spec || die "Can't copy spec file."
30     patch << "EOF" || die "Can't patch spec file."
31     --- ccs-kernel.spec
32     +++ ccs-kernel.spec
33 kumaneko 4175 @@ -15,7 +15,7 @@
34 kumaneko 4107 # that the kernel isn't the stock distribution kernel, for example,
35     # by setting the define to ".local" or ".bz123456"
36     #
37     -# % define buildid .local
38 kumaneko 5625 +%define buildid _tomoyo_1.8.3p2
39 kumaneko 4107
40     %define rhel 1
41     %if %{rhel}
42 kumaneko 5566 @@ -451,7 +451,7 @@
43 kumaneko 4175 # Packages that need to be installed before the kernel is, because the %post
44     # scripts use them.
45     #
46     -%define kernel_prereq fileutils, module-init-tools, initscripts >= 8.11.1-1, kernel-firmware >= %{rpmversion}-%{pkg_release}, grubby >= 7.0.4-1
47     +%define kernel_prereq fileutils, module-init-tools, initscripts >= 8.11.1-1, grubby >= 7.0.4-1
48     %if %{with_dracut}
49     %define initrd_prereq dracut-kernel >= 002-18.git413bcf78
50     %else
51 kumaneko 5566 @@ -487,7 +487,7 @@
52 kumaneko 4107 AutoProv: yes\
53     %{nil}
54    
55     -Name: kernel%{?variant}
56     +Name: ccs-kernel%{?variant}
57     Group: System Environment/Kernel
58     License: GPLv2
59     URL: http://www.kernel.org/
60 kumaneko 5566 @@ -727,7 +727,7 @@
61 kumaneko 4107 Provides: kernel-devel-uname-r = %{KVERREL}%{?1:.%{1}}\
62     AutoReqProv: no\
63     Requires(pre): /usr/bin/find\
64     -%description -n kernel%{?variant}%{?1:-%{1}}-devel\
65     +%description -n ccs-kernel%{?variant}%{?1:-%{1}}-devel\
66     This package provides kernel headers and makefiles sufficient to build modules\
67     against the %{?2:%{2} }kernel package.\
68     %{nil}
69 kumaneko 5566 @@ -893,6 +893,10 @@
70 kumaneko 4107
71     ApplyOptionalPatch linux-kernel-test.patch
72    
73     +# TOMOYO Linux
74 kumaneko 5625 +tar -zxf %_sourcedir/ccs-patch-1.8.3-20111111.tar.gz
75 kumaneko 5566 +patch -sp1 < patches/ccs-patch-2.6.32-centos-6.1.diff
76 kumaneko 4107 +
77     # Any further pre-build tree manipulations happen here.
78    
79     chmod +x scripts/checkpatch.pl
80 kumaneko 5566 @@ -917,6 +921,9 @@
81 kumaneko 4107 for i in *.config
82     do
83     mv $i .config
84     + # TOMOYO Linux
85     + cat config.ccs >> .config
86     + sed -i -e "s/CONFIG_DEBUG_INFO=.*/# CONFIG_DEBUG_INFO is not set/" -- .config
87     Arch=`head -1 .config | cut -b 3-`
88     make ARCH=$Arch %{oldconfig_target} > /dev/null
89     echo "# $Arch" > configs/$i
90     EOF
91     echo ""
92     echo ""
93     echo ""
94     echo "Edit /root/rpmbuild/SPECS/ccs-kernel.spec if needed, and run"
95     echo "rpmbuild -bb /root/rpmbuild/SPECS/ccs-kernel.spec"
96     echo "to build kernel rpm packages."
97     echo ""
98     ARCH=`uname -m`
99     echo "I'll start 'rpmbuild -bb --target $ARCH --with baseonly --without debug --without debuginfo /root/rpmbuild/SPECS/ccs-kernel.spec' in 30 seconds. Press Ctrl-C to stop."
100     sleep 30
101     exec rpmbuild -bb --target $ARCH --with baseonly --without debug --without debuginfo /root/rpmbuild/SPECS/ccs-kernel.spec
102     exit 0

Properties

Name Value
svn:executable *

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26