From 3d1bee6c001f3fb131d8c42a41fbb2adeacd70b9 Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Fri, 13 Aug 2010 18:17:01 +0400 Subject: [PATCH] b=21452 kABI tracking Changes required to build packages that properly interact with the kABI tracking included in SLES and RHEL kernels: - take local copies of the find_requires generators and make modif- ications to them so that they can find the kernel artifacts installed in our build tree + thusly, override the __find_requires macro in all of the RPM build operations Fix package versioning of patchless packages to also include the timestamp, just like patched packages do, for non-release builds. Also, remove the _lustre from the kernel version in the lustre package names for patchless packages. Note that changes needed to enable the external dependency checker and thus include kABI dependencies in the RPM are not included here for RHEL5. Once RH have updated their kABI whitelist to include the symbols we need, the patches in bz attachments 30546-7 need to land for RHEL5 weak modules to work and a bug needs to be filed with OFA to land the change in bz attachment 30547. i=wangyb i=mjmac --- build/lbuild | 53 ++++++++++++++++++++++++++++++++++++++++++++++------- build/lbuild-rhel5 | 18 ++++++++++++++++++ build/lbuild-sles | 1 + build/lbuild-sles10 | 11 ++++++++++- lustre.spec.in | 20 ++++++++++++++++++++ 5 files changed, 95 insertions(+), 8 deletions(-) diff --git a/build/lbuild b/build/lbuild index 15b78be..32b4f5d 100755 --- a/build/lbuild +++ b/build/lbuild @@ -637,11 +637,10 @@ load_target() { elif ! $RELEASE; then # if there is no patch series, then this is not a lustre specific # kernel. don't make it look like one - if [ -n "$SERIES" ]; then - #remove the @VERSION@ (lustre version) -# EXTRA_VERSION=$(echo $EXTRA_VERSION | sed -e "s/\(.*_lustre\)\..*/\1/") + if $PATCHLESS || [ -n "$SERIES" ]; then + EXTRA_VERSION=$(echo $EXTRA_VERSION | sed -e "s/\(.*_lustre\)\..*/\1/") # EXTRA_VERSION="${EXTRA_VERSION}-${TAG}.${TIMESTAMP}" - ! ( $PATCHLESS ) && EXTRA_VERSION="${EXTRA_VERSION}.${TIMESTAMP}" + EXTRA_VERSION="${EXTRA_VERSION}.${TIMESTAMP}" fi fi # EXTRA_VERSION=${EXTRA_VERSION//-/_} @@ -856,6 +855,7 @@ build_lustre() { $RPMBUILD $targets $rpmbuildopt ../lustre.spec \ ${is_patchless:+--define "lustre_name lustre-client"} \ ${lustre_tests:+--define "build_lustre_tests 0"} \ + ${FIND_REQUIRES:+--define "__find_requires $FIND_REQUIRES"} \ --define "configure_args $confoptions ${CONFIGURE_FLAGS}" \ --define "_tmppath $TMPDIR" \ --define "_topdir $TOPDIR" 2>&1 || \ @@ -1085,7 +1085,7 @@ build_kernel_ib() { rpm --define "_topdir ${TOPDIR}" -ivh $SOURCE SOURCE="${TOPDIR}/SPECS/ofa_kernel.spec" local file ed_fragment1 ed_fragment2 n=1 - for file in ${TOPDIR}/lustre/build/patches/ofed/*; do + for file in $(ls ${TOPDIR}/lustre/build/patches/ofed/*); do ed_fragment1="$ed_fragment1 Patch$n: ${file%%*/}" ed_fragment2="$ed_fragment2 @@ -1094,7 +1094,8 @@ Patch$n: ${file%%*/}" let n=$n+1 done - ed $SOURCE < /dev/null 2>&1; then + if ! rpm2cpio < "$kernelrpm" | cpio -id ./usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$TARGET_ARCH/$RPMSMPTYPE/Module.symvers ./boot/sym\* > /dev/null 2>&1; then return 255 fi + # now just sanity check that everything needed to build properly versioned + # modules is in place + if [ ! -f usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$TARGET_ARCH/$RPMSMPTYPE/Module.symvers ]; then + fatal 1 "cannot build kernel modules: the Kernel's Module.symvers is missing." + fi + if [ ! -f boot/symsets-${lnxmaj}${lnxmin}-${lnxrel}-$RPMSMPTYPE.tar.gz ]; then + fatal 1 "cannot build modules: the Kernel's symsets is missing." + fi + return 0 } diff --git a/lustre.spec.in b/lustre.spec.in index 62d958a..7d9347e 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -5,6 +5,26 @@ %{!?lustre_name: %define lustre_name lustre} %{!?build_lustre_tests: %define build_lustre_tests 1} +# in order to get kernel symset and/or kernel module dependencies into +# the RPM, in order to support weak-modules, the internal dependency gen- +# erator needs to be disabled +# this is done with (reduce the double % down to a single %): +# +# %%global _use_internal_dependency_generator 0 +# +# on SLES10, /usr/lib/rpm/macros already sets this, so no harm in also +# defining it here (until Suse changes their mind) +# +# on RHEL5, however, we do need to explicitly disable the internal dep- +# endency generator and allow the external one be used +# but since RedHat's kABI is only a subset of the total kernel ABI, it +# doesn't include all of the symbols we (or OFED for that matter) need +# until RedHat includes all of the symbols we need in their symsets we +# cannot support weak-modules +# we did e-mail the maintainer of all of this stuff @redhat but got no +# response from them +#%%global _use_internal_dependency_generator 0 + %define is_client %(bash -c "if [[ %{lustre_name} = *-client ]]; then echo -n '1'; else echo -n '0'; fi") # for those uses that don't want the -smp/-bigsmp on the end of %kversion %define krequires %(bash -c "echo %{kversion} | sed -e 's/.x86_64$//' -e 's/.i586$//' -e 's/-smp$//' -e 's/-bigsmp$//' -e 's/-ppc64$//' -e 's/-default$//'") -- 1.8.3.1