X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=build%2Flbuild-sles;h=e61b27fe459f51f93f3cd046417787e2ad8a5d08;hp=5b9706455de8081009f184c2baf02b77d08d7056;hb=c88317218461159cae399f74b459a850ae3c84f8;hpb=90937a348cf0f98860b5cedcb25fded9f83d357b diff --git a/build/lbuild-sles b/build/lbuild-sles index 5b97064..e61b27f 100644 --- a/build/lbuild-sles +++ b/build/lbuild-sles @@ -1,13 +1,19 @@ # 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() { pushd $TOPDIR >/dev/null - # seems there is a bug (on Ubuntu at least) where all of the .specs - # are not put into SPECS - mv SOURCES/*.spec SPECS/ + # all of the specs but one are put into SOURCES, so let's just move + # the one lone one in SPECS into SOURCES and just reference them from + # there + mv SPECS/*.spec SOURCES/ # generate our buildid local buildid="lustre${EXTRA_VERSION##*_lustre}" @@ -44,7 +50,7 @@ prepare_and_build_srpm() { # now build it if ! $RPMBUILD $rpmbuildopt $targets \ --define "_topdir $TOPDIR" \ - $TOPDIR/SPECS/kernel-$RPMSMPTYPE.spec >&2; then + $TOPDIR/SOURCES/kernel-$RPMSMPTYPE.spec 2>&1; then fatal 1 "Failed to build kernel RPM" fi #fi @@ -52,7 +58,7 @@ prepare_and_build_srpm() { # for SLES, we also need to build the kernel-source rpm if ! $RPMBUILD $rpmbuildopt $targets \ --define "_topdir $TOPDIR" \ - $TOPDIR/SPECS/kernel-source.spec >&2; then + $TOPDIR/SOURCES/kernel-source.spec 2>&1; then fatal 1 "Failed to build kernel source RPM" fi @@ -75,5 +81,54 @@ rpm_BUILD_kernel_dirname() { local lnxmin="$3" local arch="$4" - echo kernel-lustre-${rpmsmptype}-${lnxmaj}${lnxmin}/linux-${lnxmaj} + local lustre="" + if $KERNEL_LUSTRE_NAMING; then + $lustre="-lustre" + fi + 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} + 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 +} + +mcpu_rpmbuild_opt() { + + echo "--define \'jobs $(/usr/bin/getconf _NPROCESSORS_ONLN)\'" + return 0 }