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

Subversion リポジトリの参照

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5814 - (show annotations) (download) (as text)
Fri Jan 27 06:13:37 2012 UTC (12 years, 3 months ago) by kumaneko
File MIME type: text/x-sh
File size: 3621 byte(s)


1 #! /bin/sh
2 #
3 # This is a kernel build script for CentOS 6.2's 2.6.32 kernel.
4 #
5
6 die () {
7 echo $1
8 exit 1
9 }
10
11 cd /tmp/ || die "Can't chdir to /tmp/ ."
12
13 if [ ! -r kernel-2.6.32-220.4.1.el6.src.rpm ]
14 then
15 wget http://vault.centos.org/6.2/updates/Source/SPackages/kernel-2.6.32-220.4.1.el6.src.rpm || die "Can't download source package."
16 fi
17 rpm --checksig kernel-2.6.32-220.4.1.el6.src.rpm || die "Can't verify signature."
18 rpm -ivh kernel-2.6.32-220.4.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
22 cd /root/rpmbuild/SOURCES/ || die "Can't chdir to /root/rpmbuild/SOURCES/ ."
23 if [ ! -r ccs-patch-1.8.3-20120120.tar.gz ]
24 then
25 wget -O ccs-patch-1.8.3-20120120.tar.gz 'http://sourceforge.jp/frs/redir.php?f=/tomoyo/49684/ccs-patch-1.8.3-20120120.tar.gz' || die "Can't download patch."
26 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 @@ -15,7 +15,7 @@
34 # 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 +%define buildid _tomoyo_1.8.3p4
39
40 %define rhel 1
41 %if %{rhel}
42 @@ -451,7 +451,7 @@
43 # 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 @@ -487,7 +487,7 @@
52 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 @@ -737,7 +737,7 @@
61 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 @@ -903,6 +903,10 @@
70
71 ApplyOptionalPatch linux-kernel-test.patch
72
73 +# TOMOYO Linux
74 +tar -zxf %_sourcedir/ccs-patch-1.8.3-20120120.tar.gz
75 +patch -sp1 < patches/ccs-patch-2.6.32-centos-6.2.diff
76 +
77 # Any further pre-build tree manipulations happen here.
78
79 chmod +x scripts/checkpatch.pl
80 @@ -927,6 +931,9 @@
81 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