1 # vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
3 # increment this if you have made a change that should force a new kernel
4 # to be built for this release of this distribution (only -- if you want to
5 # force a kernel build on all releases of this distribution, update the BUILD_GEN
6 # variable in build/lbuild-rhel and if you want to force kernel bulid for all
7 # distributions, update the BUILD_GEN variable in build/lbuild)
10 # This distro does not support zfs, so define ZFSNOTSUPPORTED
11 # use words that make the bash log readable.
12 ZFSNOTSUPPORTED="Zfs Not Supported"
14 source ${LBUILD_DIR}/lbuild-rhel
16 SPEC_NAME="kernel-2.6.spec"
21 # edit the SPEC with our changes
22 patch_spec_common "$buildid"
23 sed -i -e '/^# empty final patch file to facilitate testing of kernel patches/i\
24 # adds Lustre patches\
25 Patch99995: linux-%{kversion}-lustre.patch' \
26 -e '/^# conditionally applied test patch for debugging convenience/i\
30 -e '/-e $RPM_SOURCE_DIR\/kabi_whitelist_/i\
31 rm -f $RPM_SOURCE_DIR/kabi_whitelist_%{_target_cpu}$Flavour' \
32 -e '/_sourcedir\/kabitool -b \./a\
33 cp $RPM_BUILD_ROOT/kabi_whitelist $RPM_SOURCE_DIR/kabi_whitelist_%{_target_cpu}$Flavour' \
34 -e '/^%prep$/,/^# END OF PATCH APPLICATIONS$/s/kernel-%{kversion}/%{name}-%{kversion}/g' \
35 -e 's/^\(%define signmodules \).*/\10/' \
36 SPECS/$SPEC_NAME 2>&1 || \
37 fatal 1 "Error while editing SPECS/$SPEC_NAME"
39 if $KERNEL_LUSTRE_NAMING; then
40 # these are all of the changes needed because we change the package names
41 # to kernel-lustre-*. these should all go away when we stop this insanity
42 sed -i -e 's/^\(Name:.*kernel\)/\1-lustre/' \
43 -e '/^Provides: glibc-kernheaders = /a\
44 Provides: kernel-headers = %{rpmversion}-%{release}
45 Obsoletes: kernel-headers
47 -e '/^Provides: kernel-%{_target_cpu} = %{rpmversion}-%{release}$/a\
48 Provides: kernel = %{rpmversion}-%{release}
50 -e '/^Provides: kernel-devel-%{_target_cpu} = %{rpmversion}-%{release}$/a\
51 Provides: kernel-devel = %{rpmversion}-%{release}
52 Obsoletes: kernel-devel
54 -e '/^Provides: %{name}-debuginfo-common-%{_target_cpu} = %{KVERREL}$/a\
55 Provides: kernel-debuginfo-common = %{KVERREL}
56 Obsoletes: kernel-debuginfo-common
58 -e '/^Provides: %{name}-debuginfo-%{_target_cpu} = %{KVERREL}$/a\
59 Provides: kernel-debuginfo = %{KVERREL}
60 Obsoletes: kernel-debuginfo
62 SPECS/$SPEC_NAME 2>&1 || \
63 fatal 1 "Error while editing SPECS/$SPEC_NAME"
66 # finally, work around RH bug 491775, if needed
67 if ! grep -q "cp -a asm-x86_64 \$RPM_BUILD_ROOT/lib/modules/\$KernelVer/build/include" \
68 SPECS/$SPEC_NAME; then
69 # XXX - i wonder if we will need to do this ad-hoc patching enough to
70 # formalize a patching system. let's assume not for the time
72 patch -s -p0 <<"EOF" 2>&1 || \
73 fatal 1 "Error while patching SPECS/$SPEC_NAME"
74 --- SPECS/$SPEC_NAME.dist 2009-03-23 20:30:55.000000000 -0400
75 +++ SPECS/$SPEC_NAME 2009-03-23 20:37:03.000000000 -0400
76 @@ -6961,6 +6961,10 @@
78 cp -a acpi config keys linux math-emu media mtd net pcmcia rdma rxrpc scsi sound video asm asm-generic $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include
79 cp -a `readlink asm` $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include
80 + if [ "$Arch" = "i386" ]; then
81 + mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/asm-x86_64
82 + cp -a asm-x86_64/{stacktrace,k8,pci-direct}.h $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include/asm-x86_64
84 if [ "$Arch" = "x86_64" ]; then
85 cp -a asm-i386 $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include
94 unpack_linux_devel_rpm-rhel5() {
95 local callers_rpm="$1"
97 unpack_linux_devel_rpm-rhel "$callers_rpm"
100 if [ ! -f usr/src/kernels/${lnxmaj}${lnxmin}-${lnxrel}-$TARGET_ARCH/symsets-${lnxmaj}${lnxmin}-${lnxrel}.tar.gz ]; then
101 fatal 1 "cannot build modules: the Kernel's symsets is missing."
109 find_linux_rpm-rhel5() {
111 local wanted_kernel="$2"
112 local pathtorpms=${3:-"${KERNELRPMSBASE}/${lnxmaj}/${DISTRO}/${TARGET_ARCH}"}
114 find_linux_rpm-rhel "$prefix" "$wanted_kernel" "$pathtorpms"
117 kernel_srpm_location() {
119 echo "http://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/SRPMS/"