1 |
#! /bin/sh |
#! /bin/sh |
2 |
# |
# |
3 |
# This is a kernel build script for CentOS 6.0's 2.6.32 kernel. |
# This is a kernel build script for CentOS 6.1's 2.6.32 kernel. |
4 |
# |
# |
5 |
|
|
6 |
die () { |
die () { |
10 |
|
|
11 |
cd /tmp/ || die "Can't chdir to /tmp/ ." |
cd /tmp/ || die "Can't chdir to /tmp/ ." |
12 |
|
|
13 |
if [ ! -r kernel-2.6.32-71.29.1.el6.src.rpm ] |
if [ ! -r kernel-2.6.32-131.17.1.el6.src.rpm ] |
14 |
then |
then |
15 |
wget http://ftp.riken.jp/Linux/centos/6.0/updates/SRPMS/kernel-2.6.32-71.29.1.el6.src.rpm || die "Can't download source package." |
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 |
fi |
fi |
17 |
rpm --checksig kernel-2.6.32-71.29.1.el6.src.rpm || die "Can't verify signature." |
rpm --checksig kernel-2.6.32-131.17.1.el6.src.rpm || die "Can't verify signature." |
18 |
rpm -ivh kernel-2.6.32-71.29.1.el6.src.rpm || die "Can't install source package." |
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 |
|
|
22 |
cd /root/rpmbuild/SOURCES/ || die "Can't chdir to /root/rpmbuild/SOURCES/ ." |
cd /root/rpmbuild/SOURCES/ || die "Can't chdir to /root/rpmbuild/SOURCES/ ." |
23 |
if [ ! -r ccs-patch-1.8.3-20110929.tar.gz ] |
if [ ! -r ccs-patch-1.8.3-20110929.tar.gz ] |
39 |
|
|
40 |
%define rhel 1 |
%define rhel 1 |
41 |
%if %{rhel} |
%if %{rhel} |
42 |
@@ -453,7 +453,7 @@ |
@@ -451,7 +451,7 @@ |
43 |
# Packages that need to be installed before the kernel is, because the %post |
# Packages that need to be installed before the kernel is, because the %post |
44 |
# scripts use them. |
# scripts use them. |
45 |
# |
# |
48 |
%if %{with_dracut} |
%if %{with_dracut} |
49 |
%define initrd_prereq dracut-kernel >= 002-18.git413bcf78 |
%define initrd_prereq dracut-kernel >= 002-18.git413bcf78 |
50 |
%else |
%else |
51 |
@@ -489,7 +489,7 @@ |
@@ -487,7 +487,7 @@ |
52 |
AutoProv: yes\ |
AutoProv: yes\ |
53 |
%{nil} |
%{nil} |
54 |
|
|
57 |
Group: System Environment/Kernel |
Group: System Environment/Kernel |
58 |
License: GPLv2 |
License: GPLv2 |
59 |
URL: http://www.kernel.org/ |
URL: http://www.kernel.org/ |
60 |
@@ -715,7 +715,7 @@ |
@@ -727,7 +727,7 @@ |
61 |
Provides: kernel-devel-uname-r = %{KVERREL}%{?1:.%{1}}\ |
Provides: kernel-devel-uname-r = %{KVERREL}%{?1:.%{1}}\ |
62 |
AutoReqProv: no\ |
AutoReqProv: no\ |
63 |
Requires(pre): /usr/bin/find\ |
Requires(pre): /usr/bin/find\ |
66 |
This package provides kernel headers and makefiles sufficient to build modules\ |
This package provides kernel headers and makefiles sufficient to build modules\ |
67 |
against the %{?2:%{2} }kernel package.\ |
against the %{?2:%{2} }kernel package.\ |
68 |
%{nil} |
%{nil} |
69 |
@@ -881,6 +881,10 @@ |
@@ -893,6 +893,10 @@ |
70 |
|
|
71 |
ApplyOptionalPatch linux-kernel-test.patch |
ApplyOptionalPatch linux-kernel-test.patch |
72 |
|
|
73 |
+# TOMOYO Linux |
+# TOMOYO Linux |
74 |
+tar -zxf %_sourcedir/ccs-patch-1.8.3-20110929.tar.gz |
+tar -zxf %_sourcedir/ccs-patch-1.8.3-20110929.tar.gz |
75 |
+patch -sp1 < patches/ccs-patch-2.6.32-centos-6.0.diff |
+patch -sp1 < patches/ccs-patch-2.6.32-centos-6.1.diff |
76 |
+ |
+ |
77 |
# Any further pre-build tree manipulations happen here. |
# Any further pre-build tree manipulations happen here. |
78 |
|
|
79 |
chmod +x scripts/checkpatch.pl |
chmod +x scripts/checkpatch.pl |
80 |
@@ -905,6 +909,9 @@ |
@@ -917,6 +921,9 @@ |
81 |
for i in *.config |
for i in *.config |
82 |
do |
do |
83 |
mv $i .config |
mv $i .config |