X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=build%2Flbuild-sles;h=e61b27fe459f51f93f3cd046417787e2ad8a5d08;hp=94af57ad423962c6f6034a5e5b4477d5fcac6841;hb=8053e1507683f8731f97e6ae4a6fce90293fdbaf;hpb=4557e3e767c961e019070253317c1aeeec5e1803 diff --git a/build/lbuild-sles b/build/lbuild-sles index 94af57a..e61b27f 100644 --- a/build/lbuild-sles +++ b/build/lbuild-sles @@ -1,6 +1,11 @@ # vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4: +# increment this if you have made a change that should force a new kernel +# to build built +BUILD_GEN+=".0" # TT-107: don't cache the BUILD dir (reset major to 5) + DEVEL_KERNEL_TYPE="source" +RPM_HELPERS_DIR="/usr/lib/rpm" prepare_and_build_srpm() { @@ -83,25 +88,43 @@ rpm_BUILD_kernel_dirname() { echo kernel${lustre}-${rpmsmptype}-${lnxmaj}${lnxmin}/linux-${lnxmaj} } -find_linux_devel_paths() { - local path="$1" +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" - LINUX=$path/usr/src/linux-${lnxmaj}${lnxmin}${delimiter}${lnxrel##${lnxmin#.}-} +} - local objects=$TARGET_ARCH/$RPMSMPTYPE - if [ -d $path/usr/src/linux-${lnxmaj}${lnxmin}${delimiter}${lnxrel##${lnxmin#.}-}-obj/powerpc ]; then - objects="powerpc/$TARGET_ARCH" - elif [ $TARGET_ARCH == 'i686' ]; then - objects="i386/$RPMSMPTYPE" - fi +find_linux_devel_paths() { + local path="$1" - LINUXOBJ=$path/usr/src/linux-${lnxmaj}${lnxmin}${delimiter}${lnxrel##${lnxmin#.}-}-obj/$objects + LINUX=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel} + 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 - LINUXRELEASE=$(find_linux_release ${LINUXOBJ:-$LINUX}) - if [ -z "$LINUXRELEASE" ]; then - echo "Failed to find linux release in ${LINUXOBJ:-$LINUX}" - return 255 - fi + return 0 } mcpu_rpmbuild_opt() { @@ -109,4 +132,3 @@ mcpu_rpmbuild_opt() { echo "--define \'jobs $(/usr/bin/getconf _NPROCESSORS_ONLN)\'" return 0 } -