X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=build%2Flbuild-rhel5;h=11d9545a8b6442eefdf781be157e9dee5ec85647;hp=b359583ecc551c9365e744b3ed0ebea7038a1581;hb=e14d4dd61348297f1627c65073a2d908e54977a3;hpb=eea0b5248b5c08acb1a20f47f40bc5672db62dd4 diff --git a/build/lbuild-rhel5 b/build/lbuild-rhel5 index b359583..11d9545 100644 --- a/build/lbuild-rhel5 +++ b/build/lbuild-rhel5 @@ -7,6 +7,7 @@ BUILD_GEN=3 # bz19975 enable the building of src.rpms by default DEVEL_KERNEL_TYPE="devel" +RPM_HELPERS_DIR="/usr/lib/rpm/redhat" prepare_and_build_srpm() { @@ -52,8 +53,10 @@ Patch99995: linux-%{kversion}-lustre.patch' \ ' \ -e '/^%prep$/,/^# END OF PATCH APPLICATIONS$/s/kernel-%{kversion}/%{name}-%{kversion}/g' \ -e '/find $RPM_BUILD_ROOT\/lib\/modules\/$KernelVer/a\ - cp -a fs/ext3/* $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/fs/ext3' \ - SPECS/kernel-2.6.spec + cp -a fs/ext3/* $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/fs/ext3 \ + cp -a fs/ext4/* $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/fs/ext4' \ + SPECS/kernel-2.6.spec 2>&1 || \ + fatal 1 "Error while editing SPECS/kernel-2.6.spec" if $KERNEL_LUSTRE_NAMING; then # these are all of the changes needed because we change the package names @@ -78,20 +81,27 @@ Obsoletes: kernel-debuginfo-common Provides: kernel-debuginfo = %{KVERREL} Obsoletes: kernel-debuginfo ' \ - SPECS/kernel-2.6.spec + SPECS/kernel-2.6.sp 2>&1 || \ + fatal 1 "Error while editing SPECS/kernel-2.6.spec"ec fi # XXX - a building-on-Ubuntu hack if grep -q "Ubuntu" /etc/issue; then sed -i -e 's/^\(BuildPreReq: .*\)$/#NOU \1/g' \ -e 's/^\(BuildRequires: .*\)$/#NOU \1/g' \ - SPECS/kernel-2.6.spec + -e 's/sha512hmac/md5sum/g' \ + SPECS/kernel-2.6.spec 2>&1 || \ + fatal 1 "Error while editing SPECS/kernel-2.6.spec" fi - # finally, work around RH bug 491775 - # XXX - i wonder if we will need to do this enough to formalize a - # patching system. let's assume not for the time being. - patch -s -p0 <<"EOF" + # finally, work around RH bug 491775, if needed + if ! grep -q "cp -a asm-x86_64 \$RPM_BUILD_ROOT/lib/modules/\$KernelVer/build/include" \ + SPECS/kernel-2.6.spec; then + # XXX - i wonder if we will need to do this ad-hoc patching enough to + # formalize a patching system. let's assume not for the time + # being. + patch -s -p0 <<"EOF" 2>&1 || \ + fatal 1 "Error while patching SPECS/kernel-2.6.spec" --- SPECS/kernel-2.6.spec.dist 2009-03-23 20:30:55.000000000 -0400 +++ SPECS/kernel-2.6.spec 2009-03-23 20:37:03.000000000 -0400 @@ -6961,6 +6961,10 @@ @@ -106,6 +116,7 @@ Obsoletes: kernel-debuginfo cp -a asm-i386 $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/include fi EOF + fi popd >/dev/null @@ -156,10 +167,12 @@ EOF # now build it if ! $RPMBUILD $rpmbuildopt $targets --with baseonly \ --define "_topdir $TOPDIR" \ - $TOPDIR/SPECS/kernel-2.6.spec >&2; then - fatal 1 "Failed to build kernel RPM" + $TOPDIR/SPECS/kernel-2.6.spec 2>&1; then + return 1 fi + return 0 + } devel_kernel_name() { @@ -185,3 +198,42 @@ rpm_BUILD_kernel_dirname() { fi echo kernel${lustre}${lnxmaj}${lnxmin}/linux-${lnxmaj}.$arch } + +find_linux_devel_paths() { + local path="$1" + local ARCH=$TARGET_ARCH + + # If DEVEL_PATH_ARCH is set, use it. Added for fc11 as it needs i586 string for i686. + if [ $DEVEL_PATH_ARCH ];then + ARCH=$DEVEL_PATH_ARCH + fi + + LINUX=$path/usr/src/kernels/${lnxmaj}${lnxmin}-${lnxrel}${DEVEL_PATH_ARCH_DELIMETER:-"-"}${ARCH} + # RHEL doesn't have the -obj tree + LINUXOBJ="" + # XXX - i don't think we need this any more + #LINUXRELEASE=$(find_linux_release "$LINUX") + #if [ -z "$LINUXRELEASE" ]; then + # echo "Failed to find linux release in $LINUX" + # return 255 + #fi + + return 0 +} + +unpack_linux_devel_rpm-rhel5() { + local callers_rpm="$1" + + # now just sanity check that everything needed to build properly versioned + # modules is in place + if [ ! -f usr/src/kernels/${lnxmaj}${lnxmin}-${lnxrel}-$TARGET_ARCH/Module.symvers ]; then + fatal 1 "cannot build kernel modules: the Kernel's Module.symvers is missing." + fi + + if [ ! -f usr/src/kernels/${lnxmaj}${lnxmin}-${lnxrel}-$TARGET_ARCH/symsets-${lnxmaj}${lnxmin}-${lnxrel}.tar.gz ]; then + fatal 1 "cannot build modules: the Kernel's symsets is missing." + fi + + return 0 + +}