1 |
kumaneko |
1109 |
#! /bin/sh |
2 |
|
|
# |
3 |
|
|
# This is a kernel build script for Fedora Core 6's 2.6.22 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.22.14-72.fc6.src.rpm ] |
14 |
|
|
then |
15 |
|
|
wget http://ftp.riken.jp/Linux/fedora/core/updates/6/SRPMS/kernel-2.6.22.14-72.fc6.src.rpm || die "Can't download source package." |
16 |
|
|
fi |
17 |
|
|
rpm -ivh kernel-2.6.22.14-72.fc6.src.rpm || die "Can't install source package." |
18 |
|
|
|
19 |
|
|
cd /usr/src/redhat/SOURCES/ || die "Can't chdir to /usr/src/redhat/SOURCES/ ." |
20 |
|
|
if [ ! -r ccs-patch-1.6.0-20080401.tar.gz ] |
21 |
|
|
then |
22 |
|
|
wget http://osdn.dl.sourceforge.jp/tomoyo/30297/ccs-patch-1.6.0-20080401.tar.gz || die "Can't download patch." |
23 |
|
|
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 |
|
|
--- kernel-2.6.spec 2007-11-22 03:35:14.000000000 +0900 |
29 |
|
|
+++ kernel-2.6.spec 2008-04-16 12:00:45.000000000 +0900 |
30 |
|
|
@@ -12,7 +12,7 @@ |
31 |
|
|
# that the kernel isn't the stock distribution kernel, for example, |
32 |
|
|
# by setting the define to ".local" or ".bz123456" |
33 |
|
|
# |
34 |
|
|
-#% define buildid .local |
35 |
|
|
+%define buildid _tomoyo_1.6.0 |
36 |
|
|
|
37 |
|
|
# fedora_build defines which build revision of this kernel version we're |
38 |
|
|
# building. Rather than incrementing forever, as with the prior versioning |
39 |
|
|
@@ -364,6 +364,11 @@ |
40 |
|
|
# to versions below the minimum |
41 |
|
|
# |
42 |
|
|
|
43 |
|
|
+# TOMOYO Linux |
44 |
|
|
+%define with_modsign 0 |
45 |
|
|
+%define _enable_debug_packages 0 |
46 |
|
|
+%define with_debuginfo 0 |
47 |
|
|
+ |
48 |
|
|
# |
49 |
|
|
# First the general kernel 2.6 required versions as per |
50 |
|
|
# Documentation/Changes |
51 |
|
|
@@ -389,11 +394,11 @@ |
52 |
|
|
# |
53 |
|
|
%define kernel_prereq fileutils, module-init-tools, initscripts >= 8.11.1-1, mkinitrd >= 5.1.19.0.3-1 |
54 |
|
|
|
55 |
|
|
-Name: kernel%{?variant} |
56 |
|
|
+Name: ccs-kernel%{?variant} |
57 |
|
|
Group: System Environment/Kernel |
58 |
|
|
License: GPLv2 |
59 |
|
|
Version: %{rpmversion} |
60 |
|
|
-Release: %{pkg_release} |
61 |
|
|
+Release: %{pkg_release}.fc6 |
62 |
|
|
# DO NOT CHANGE THE 'ExclusiveArch' LINE TO TEMPORARILY EXCLUDE AN ARCHITECTURE BUILD. |
63 |
|
|
# SET %nobuildarches (ABOVE) INSTEAD |
64 |
|
|
ExclusiveArch: noarch %{all_x86} x86_64 ppc ppc64 ia64 sparc sparc64 s390x alpha alphaev56 |
65 |
|
|
@@ -1359,6 +1364,11 @@ |
66 |
|
|
|
67 |
|
|
# END OF PATCH APPLICATIONS |
68 |
|
|
|
69 |
|
|
+# TOMOYO Linux |
70 |
|
|
+tar -zxf %_sourcedir/ccs-patch-1.6.0-20080401.tar.gz |
71 |
|
|
+sed -i -e 's:EXTRAVERSION =.*:EXTRAVERSION = .14-72.fc6:' -- Makefile |
72 |
|
|
+patch -sp1 < patches/ccs-patch-2.6.22.14-72.fc6.diff |
73 |
|
|
+ |
74 |
|
|
# Any further pre-build tree manipulations happen here. |
75 |
|
|
|
76 |
|
|
chmod +x scripts/checkpatch.pl |
77 |
|
|
@@ -1379,6 +1389,9 @@ |
78 |
|
|
for i in *.config |
79 |
|
|
do |
80 |
|
|
mv $i .config |
81 |
|
|
+ # TOMOYO Linux |
82 |
|
|
+ cat config.ccs >> .config |
83 |
|
|
+ sed -i -e 's:CONFIG_DEBUG_INFO=.*:# CONFIG_DEBUG_INFO is not set:' -- .config |
84 |
|
|
Arch=`head -1 .config | cut -b 3-` |
85 |
|
|
make ARCH=$Arch %{oldconfig_target} > /dev/null |
86 |
|
|
echo "# $Arch" > configs/$i |
87 |
|
|
EOF |
88 |
|
|
mv kernel-2.6.spec kernel-2.6.22.14-72.fc6_tomoyo_1.6.0.spec || die "Can't rename spec file." |
89 |
|
|
echo "" |
90 |
|
|
echo "" |
91 |
|
|
echo "" |
92 |
|
|
echo "Edit /tmp/kernel-2.6.22.14-72.fc6_tomoyo_1.6.0.spec if needed, and run" |
93 |
|
|
echo "rpmbuild -bb /tmp/kernel-2.6.22.14-72.fc6_tomoyo_1.6.0.spec" |
94 |
|
|
echo "to build kernel rpm packages." |
95 |
|
|
exit 0 |