From 5bb7dc0fd7e5d0480a2317c91515a3d45e80519a Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Fri, 25 Jun 2010 09:49:13 -0400 Subject: [PATCH] b=23185 properly support sles10 ppc64 We never really have properly supported ppc64 on sles10: - RPMSMPTYPE for ppc64 on SLES10 is ppc64, not smp - add a function to resolve an arch to their canonical value Comment out some code to align the sles distro lbuild with rhel5. --- build/lbuild | 4 +++ build/lbuild-sles | 37 +++++++++++++--------- build/lbuild-sles10 | 2 +- ...=> kernel-2.6.16-2.6-sles10-ppc64-ppc64.config} | 0 lustre/kernel_patches/targets/2.6-sles10.target.in | 3 +- 5 files changed, 29 insertions(+), 17 deletions(-) rename lustre/kernel_patches/kernel_configs/{kernel-2.6.16-2.6-sles10-ppc64-smp.config => kernel-2.6.16-2.6-sles10-ppc64-ppc64.config} (100%) diff --git a/build/lbuild b/build/lbuild index 32b4f5d..c99ade4 100755 --- a/build/lbuild +++ b/build/lbuild @@ -965,6 +965,10 @@ set_rpm_smp_type() { [ $infact_arch == $smp_type ] && RPMSMPTYPE=bigsmp && break done + for smp_type in $PPC64_ARCHS; do + [ $infact_arch == $smp_type ] && RPMSMPTYPE=ppc64 && break + done + for smp_type in $DEFAULT_ARCHS; do [ $infact_arch == $smp_type ] && RPMSMPTYPE=default && break done diff --git a/build/lbuild-sles b/build/lbuild-sles index 1f1bb8f..1e3902d2 100644 --- a/build/lbuild-sles +++ b/build/lbuild-sles @@ -84,25 +84,32 @@ rpm_BUILD_kernel_dirname() { echo kernel${lustre}-${rpmsmptype}-${lnxmaj}${lnxmin}/linux-${lnxmaj} } -find_linux_devel_paths() { - local path="$1" +resolve_arch() { + local arch="$1" - LINUX=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel} + case $arch in + ppc64) arch=powerpc + ;; + i686) arch=i386 + ;; + esac - local objects=$TARGET_ARCH/$RPMSMPTYPE - if [ -d $path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/powerpc ]; then - objects="powerpc/$TARGET_ARCH" - elif [ $TARGET_ARCH == 'i686' ]; then - objects="i386/$RPMSMPTYPE" - fi + echo "$arch" + +} - LINUXOBJ=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$objects - LINUXRELEASE=$(find_linux_release "$LINUXOBJ") +find_linux_devel_paths() { + local path="$1" - if [ -z "$LINUXRELEASE" ]; then - echo "Failed to find linux release in $LINUXOBJ" - return 255 - fi + LINUX=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel} + LINUXOBJ=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH)/$RPMSMPTYPE + # XXX this has been commented out in th rhel5 build file for a while + # as it says there, it's probably not needed anymore and can be deleted + #LINUXRELEASE=$(find_linux_release "$LINUXOBJ") + #if [ -z "$LINUXRELEASE" ]; then + # echo "Failed to find linux release in $LINUXOBJ" + # return 255 + #fi return 0 } diff --git a/build/lbuild-sles10 b/build/lbuild-sles10 index 3441a01..107af00 100644 --- a/build/lbuild-sles10 +++ b/build/lbuild-sles10 @@ -53,7 +53,7 @@ unpack_linux_devel_rpm-sles10() { # get the Module.symvers out of the kenrel-flavor RPM local kernelrpm=${callers_rpm/-source-/-$RPMSMPTYPE-} - if ! rpm2cpio < "$kernelrpm" | cpio -id ./usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$TARGET_ARCH/$RPMSMPTYPE/Module.symvers ./boot/sym\* > /dev/null 2>&1; then + if ! rpm2cpio < "$kernelrpm" | cpio -id ./usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH)/$RPMSMPTYPE/Module.symvers ./boot/sym\* > /dev/null 2>&1; then return 255 fi diff --git a/lustre/kernel_patches/kernel_configs/kernel-2.6.16-2.6-sles10-ppc64-smp.config b/lustre/kernel_patches/kernel_configs/kernel-2.6.16-2.6-sles10-ppc64-ppc64.config similarity index 100% rename from lustre/kernel_patches/kernel_configs/kernel-2.6.16-2.6-sles10-ppc64-smp.config rename to lustre/kernel_patches/kernel_configs/kernel-2.6.16-2.6-sles10-ppc64-ppc64.config diff --git a/lustre/kernel_patches/targets/2.6-sles10.target.in b/lustre/kernel_patches/targets/2.6-sles10.target.in index 8854905..1990483 100644 --- a/lustre/kernel_patches/targets/2.6-sles10.target.in +++ b/lustre/kernel_patches/targets/2.6-sles10.target.in @@ -24,9 +24,10 @@ BASE_ARCHS="i686 ppc x86_64 ia64 ppc64" BIGMEM_ARCHS="" BOOT_ARCHS="" JENSEN_ARCHS="" -SMP_ARCHS="x86_64 ia64 ppc64" +SMP_ARCHS="x86_64 ia64" BIGSMP_ARCHS="i686" PSERIES64_ARCHS="ppc" +PPC64_ARCHS="ppc64" UP_ARCHS="" SRC_ARCHS="" #RPMSMPTYPE="smp" -- 1.8.3.1