X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=build%2Flbuild-sles;h=8037bca6c58bcde7c95741061c002cbfb01f712e;hb=999a8f1f0f9ab1a47843b4fa24ff88e5afd894b2;hp=1f1bb8f4278fc1b0a77854bcfafb5e2875450294;hpb=3d1bee6c001f3fb131d8c42a41fbb2adeacd70b9;p=fs%2Flustre-release.git diff --git a/build/lbuild-sles b/build/lbuild-sles index 1f1bb8f..8037bca 100644 --- a/build/lbuild-sles +++ b/build/lbuild-sles @@ -84,25 +84,41 @@ rpm_BUILD_kernel_dirname() { echo kernel${lustre}-${rpmsmptype}-${lnxmaj}${lnxmin}/linux-${lnxmaj} } +resolve_arch() { + local arch="$1" + # because we build an i686 kernel, we need to know if the arch we are + # resolving for is for the patched or patchless kernel (which is i586) + # we really should be building an i586 kernel to match what Novell does + local for_patchless=${2:-true} + local canonical=${3:-false} + + case $arch in + ppc64) arch=powerpc + ;; + i?86) if $canonical; then + arch=i386 + elif $(eval $for_patchless); then + arch=i586 + fi + ;; + esac + + echo "$arch" + +} + find_linux_devel_paths() { local path="$1" LINUX=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel} - - 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 - - LINUXOBJ=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$objects - LINUXRELEASE=$(find_linux_release "$LINUXOBJ") - - if [ -z "$LINUXRELEASE" ]; then - echo "Failed to find linux release in $LINUXOBJ" - return 255 - fi + LINUXOBJ=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH $PATCHLESS)/$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 }