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 |
3633 |
if [ ! -r kernel-2.6.9-89.0.25.EL.src.rpm ] |
14 |
kumaneko |
1109 |
then |
15 |
kumaneko |
3633 |
wget http://ftp.riken.jp/Linux/centos/4.8/updates/SRPMS/kernel-2.6.9-89.0.25.EL.src.rpm || die "Can't download source package." |
16 |
kumaneko |
1109 |
fi |
17 |
kumaneko |
3633 |
rpm --checksig kernel-2.6.9-89.0.25.EL.src.rpm || die "Can't verify signature." |
18 |
|
|
rpm -ivh kernel-2.6.9-89.0.25.EL.src.rpm || die "Can't install source package." |
19 |
kumaneko |
1109 |
|
20 |
|
|
cd /usr/src/redhat/SOURCES/ || die "Can't chdir to /usr/src/redhat/SOURCES/ ." |
21 |
kumaneko |
3888 |
if [ ! -r ccs-patch-1.7.2-20100804.tar.gz ] |
22 |
kumaneko |
1109 |
then |
23 |
kumaneko |
3888 |
wget http://sourceforge.jp/frs/redir.php?f=/tomoyo/43375/ccs-patch-1.7.2-20100804.tar.gz || die "Can't download patch." |
24 |
kumaneko |
1109 |
fi |
25 |
|
|
|
26 |
|
|
cd /tmp/ || die "Can't chdir to /tmp/ ." |
27 |
|
|
cp -p /usr/src/redhat/SPECS/kernel-2.6.spec . || die "Can't copy spec file." |
28 |
|
|
patch << "EOF" || die "Can't patch spec file." |
29 |
kumaneko |
3657 |
--- kernel-2.6.spec |
30 |
|
|
+++ kernel-2.6.spec |
31 |
kumaneko |
1671 |
@@ -27,7 +27,7 @@ |
32 |
kumaneko |
1109 |
# that the kernel isn't the stock distribution kernel, for example by |
33 |
|
|
# adding some text to the end of the version number. |
34 |
|
|
# |
35 |
kumaneko |
3633 |
-%define release 89.0.25.EL |
36 |
kumaneko |
3888 |
+%define release 89.0.25.EL_tomoyo_1.7.2p2 |
37 |
kumaneko |
1109 |
%define sublevel 9 |
38 |
|
|
%define kversion 2.6.%{sublevel} |
39 |
|
|
%define rpmversion 2.6.%{sublevel} |
40 |
kumaneko |
1671 |
@@ -140,6 +140,9 @@ |
41 |
kumaneko |
1109 |
# to versions below the minimum |
42 |
|
|
# |
43 |
|
|
|
44 |
|
|
+# TOMOYO Linux |
45 |
|
|
+%define signmodules 0 |
46 |
|
|
+ |
47 |
|
|
# |
48 |
|
|
# First the general kernel 2.6 required versions as per |
49 |
|
|
# Documentation/Changes |
50 |
kumaneko |
1671 |
@@ -176,7 +179,7 @@ |
51 |
kumaneko |
1109 |
%define __find_provides /usr/lib/rpm/redhat/find-kmod-provides.sh |
52 |
|
|
%define __find_requires %{nil} |
53 |
|
|
|
54 |
|
|
-Name: kernel |
55 |
|
|
+Name: ccs-kernel |
56 |
|
|
Group: System Environment/Kernel |
57 |
|
|
License: GPLv2 |
58 |
|
|
Version: %{rpmversion} |
59 |
kumaneko |
3633 |
@@ -5615,6 +5618,10 @@ |
60 |
kumaneko |
1109 |
|
61 |
|
|
# END OF PATCH APPLICATIONS |
62 |
|
|
|
63 |
|
|
+# TOMOYO Linux |
64 |
kumaneko |
3888 |
+tar -zxf %_sourcedir/ccs-patch-1.7.2-20100804.tar.gz |
65 |
kumaneko |
2937 |
+patch -sp1 < patches/ccs-patch-2.6.9-centos-4.8.diff |
66 |
kumaneko |
1109 |
+ |
67 |
|
|
cp %{SOURCE10} Documentation/ |
68 |
|
|
|
69 |
|
|
mkdir configs |
70 |
kumaneko |
3633 |
@@ -5626,6 +5633,9 @@ |
71 |
kumaneko |
1109 |
for i in *.config |
72 |
|
|
do |
73 |
|
|
mv $i .config |
74 |
|
|
+ # TOMOYO Linux |
75 |
|
|
+ cat config.ccs >> .config |
76 |
|
|
+ sed -i -e "s/^CONFIG_DEBUG_INFO=.*/# CONFIG_DEBUG_INFO is not set/" -- .config |
77 |
|
|
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 |
78 |
|
|
cp .config configs/$i |
79 |
|
|
done |
80 |
|
|
EOF |
81 |
kumaneko |
1399 |
mv kernel-2.6.spec ccs-kernel.spec || die "Can't rename spec file." |
82 |
kumaneko |
1109 |
echo "" |
83 |
|
|
echo "" |
84 |
|
|
echo "" |
85 |
kumaneko |
1399 |
echo "Edit /tmp/ccs-kernel.spec if needed, and run" |
86 |
|
|
echo "rpmbuild -bb /tmp/ccs-kernel.spec" |
87 |
kumaneko |
1109 |
echo "to build kernel rpm packages." |
88 |
kumaneko |
3586 |
echo "" |
89 |
|
|
echo "I'll start 'rpmbuild -bb --target i586 /tmp/ccs-kernel.spec' in 30 seconds. Press Ctrl-C to stop." |
90 |
|
|
sleep 30 |
91 |
kumaneko |
3587 |
patch << "EOF" || die "Can't patch spec file." |
92 |
|
|
--- /tmp/ccs-kernel.spec |
93 |
|
|
+++ /tmp/ccs-kernel.spec |
94 |
|
|
@@ -4,14 +4,14 @@ |
95 |
|
|
# What parts do we want to build? We must build at least one kernel. |
96 |
|
|
# These are the kernels that are built IF the architecture allows it. |
97 |
|
|
|
98 |
|
|
-%define buildup 1 |
99 |
|
|
+%define buildup 0 |
100 |
|
|
%define buildsmp 1 |
101 |
|
|
%define buildsource 0 |
102 |
|
|
-%define buildhugemem 1 |
103 |
|
|
-%define buildlargesmp 1 |
104 |
|
|
+%define buildhugemem 0 |
105 |
|
|
+%define buildlargesmp 0 |
106 |
|
|
%define builddoc 0 |
107 |
|
|
-%define buildxen 1 |
108 |
|
|
-%define kabi 1 |
109 |
|
|
+%define buildxen 0 |
110 |
|
|
+%define kabi 0 |
111 |
|
|
|
112 |
|
|
%define FC2 0 |
113 |
|
|
%define FC3 0 |
114 |
|
|
EOF |
115 |
kumaneko |
3586 |
exec rpmbuild -bb --target i586 /tmp/ccs-kernel.spec |
116 |
kumaneko |
1109 |
exit 0 |