1 |
kumaneko |
1109 |
#! /bin/sh |
2 |
|
|
# |
3 |
kumaneko |
2937 |
# This is a kernel build script for CentOS 4.8's 2.6.9 kernel. |
4 |
kumaneko |
1109 |
# |
5 |
|
|
|
6 |
|
|
die () { |
7 |
|
|
echo $1 |
8 |
|
|
exit 1 |
9 |
|
|
} |
10 |
|
|
|
11 |
|
|
cd /tmp/ || die "Can't chdir to /tmp/ ." |
12 |
|
|
|
13 |
kumaneko |
3047 |
if [ ! -r kernel-2.6.9-89.0.11.EL.src.rpm ] |
14 |
kumaneko |
1109 |
then |
15 |
kumaneko |
3047 |
wget http://ftp.riken.jp/Linux/centos/4.8/updates/SRPMS/kernel-2.6.9-89.0.11.EL.src.rpm || die "Can't download source package." |
16 |
kumaneko |
1109 |
fi |
17 |
kumaneko |
3047 |
rpm -ivh kernel-2.6.9-89.0.11.EL.src.rpm || die "Can't install source package." |
18 |
kumaneko |
1109 |
|
19 |
|
|
cd /usr/src/redhat/SOURCES/ || die "Can't chdir to /usr/src/redhat/SOURCES/ ." |
20 |
kumaneko |
3010 |
if [ ! -r ccs-patch-1.7.0-20090911.tar.gz ] |
21 |
kumaneko |
1109 |
then |
22 |
kumaneko |
3010 |
wget http://osdn.dl.sourceforge.jp/tomoyo/43375/ccs-patch-1.7.0-20090911.tar.gz || die "Can't download patch." |
23 |
kumaneko |
1109 |
fi |
24 |
|
|
|
25 |
|
|
cd /tmp/ || die "Can't chdir to /tmp/ ." |
26 |
|
|
cp -p /usr/src/redhat/SPECS/kernel-2.6.spec . || die "Can't copy spec file." |
27 |
|
|
patch << "EOF" || die "Can't patch spec file." |
28 |
kumaneko |
3047 |
--- kernel-2.6.spec 2009-09-15 18:58:38.000000000 +0900 |
29 |
|
|
+++ kernel-2.6.spec 2009-09-16 16:37:49.000000000 +0900 |
30 |
kumaneko |
1671 |
@@ -27,7 +27,7 @@ |
31 |
kumaneko |
1109 |
# that the kernel isn't the stock distribution kernel, for example by |
32 |
|
|
# adding some text to the end of the version number. |
33 |
|
|
# |
34 |
kumaneko |
3047 |
-%define release 89.0.11.EL |
35 |
|
|
+%define release 89.0.11.EL_tomoyo_1.7.0 |
36 |
kumaneko |
1109 |
%define sublevel 9 |
37 |
|
|
%define kversion 2.6.%{sublevel} |
38 |
|
|
%define rpmversion 2.6.%{sublevel} |
39 |
kumaneko |
1671 |
@@ -140,6 +140,9 @@ |
40 |
kumaneko |
1109 |
# to versions below the minimum |
41 |
|
|
# |
42 |
|
|
|
43 |
|
|
+# TOMOYO Linux |
44 |
|
|
+%define signmodules 0 |
45 |
|
|
+ |
46 |
|
|
# |
47 |
|
|
# First the general kernel 2.6 required versions as per |
48 |
|
|
# Documentation/Changes |
49 |
kumaneko |
1671 |
@@ -176,7 +179,7 @@ |
50 |
kumaneko |
1109 |
%define __find_provides /usr/lib/rpm/redhat/find-kmod-provides.sh |
51 |
|
|
%define __find_requires %{nil} |
52 |
|
|
|
53 |
|
|
-Name: kernel |
54 |
|
|
+Name: ccs-kernel |
55 |
|
|
Group: System Environment/Kernel |
56 |
|
|
License: GPLv2 |
57 |
|
|
Version: %{rpmversion} |
58 |
kumaneko |
3047 |
@@ -5485,6 +5488,10 @@ |
59 |
kumaneko |
1109 |
|
60 |
|
|
# END OF PATCH APPLICATIONS |
61 |
|
|
|
62 |
|
|
+# TOMOYO Linux |
63 |
kumaneko |
3010 |
+tar -zxf %_sourcedir/ccs-patch-1.7.0-20090911.tar.gz |
64 |
kumaneko |
2937 |
+patch -sp1 < patches/ccs-patch-2.6.9-centos-4.8.diff |
65 |
kumaneko |
1109 |
+ |
66 |
|
|
cp %{SOURCE10} Documentation/ |
67 |
|
|
|
68 |
|
|
mkdir configs |
69 |
kumaneko |
3047 |
@@ -5496,6 +5503,9 @@ |
70 |
kumaneko |
1109 |
for i in *.config |
71 |
|
|
do |
72 |
|
|
mv $i .config |
73 |
|
|
+ # TOMOYO Linux |
74 |
|
|
+ cat config.ccs >> .config |
75 |
|
|
+ sed -i -e "s/^CONFIG_DEBUG_INFO=.*/# CONFIG_DEBUG_INFO is not set/" -- .config |
76 |
|
|
make ARCH=`echo $i | cut -d"-" -f3 | cut -d"." -f1 | sed -e s/i.86/i386/ -e s/s390x/s390/ -e s/ppc64.series/ppc64/ ` nonint_oldconfig > /dev/null |
77 |
|
|
cp .config configs/$i |
78 |
|
|
done |
79 |
|
|
EOF |
80 |
kumaneko |
1399 |
mv kernel-2.6.spec ccs-kernel.spec || die "Can't rename spec file." |
81 |
kumaneko |
1109 |
echo "" |
82 |
|
|
echo "" |
83 |
|
|
echo "" |
84 |
kumaneko |
1399 |
echo "Edit /tmp/ccs-kernel.spec if needed, and run" |
85 |
|
|
echo "rpmbuild -bb /tmp/ccs-kernel.spec" |
86 |
kumaneko |
1109 |
echo "to build kernel rpm packages." |
87 |
|
|
exit 0 |