X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=build%2Flbuild;h=7e9c63072ccb2efc2bd52e7aebc27f4924d27ad5;hb=9b73c02192b3e16c322402e8c080e660ba2c457c;hp=c76732792b980c95d52d45ab36fbfc2b53b66d22;hpb=4ecae3cd5af60e389eba1e6eff2913b09f557203;p=fs%2Flustre-release.git diff --git a/build/lbuild b/build/lbuild index c767327..7e9c630 100755 --- a/build/lbuild +++ b/build/lbuild @@ -18,6 +18,7 @@ CONFIGURE_FLAGS= EXTERNAL_PATCHES= EXTRA_VERSION= STAGEDIR= +TMPDIR=${TMPDIR:-"/var/tmp"} # from target file KERNEL= @@ -208,6 +209,9 @@ check_options() 2.6-suse) CANONICAL_TARGET="sles-2.6" ;; + 2.6-sles10) + CANONICAL_TARGET="sles10-2.6" + ;; hp_pnnl-2.4) CANONICAL_TARGET="hp-pnnl-2.4" ;; @@ -215,7 +219,8 @@ check_options() | suse-2.4.21-2 \ | rh-2.4 \ | rhel-2.4 \ - | sles-2.4) + | sles-2.4 \ + | 2.6-patchless) CANONICAL_TARGET="$TARGET" ;; esac @@ -340,9 +345,13 @@ load_target() if [ "$EXTRA_VERSION_save" ] ; then EXTRA_VERSION="$EXTRA_VERSION_save" elif ! (( $RELEASE )) ; then - #remove the @VERSION@ (lustre version) - EXTRA_VERSION=$(echo $EXTRA_VERSION | sed -e "s/\(.*_lustre\)\..*/\1/") - EXTRA_VERSION="${EXTRA_VERSION}-${TAG}.${TIMESTAMP}" + # 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/") + EXTRA_VERSION="${EXTRA_VERSION}-${TAG}.${TIMESTAMP}" + fi fi # EXTRA_VERSION=${EXTRA_VERSION//-/_} @@ -390,7 +399,7 @@ unpack_lustre() DIRNAME="lustre-$TAG-$TIMESTAMP" if [ "$LUSTRE" ] ; then untar "$LUSTRE" - [ -d lustre ] || ln -sf lustre* lustre + [ -d lustre ] || ln -sf lustre-[0-9].[0-9]* lustre else if [ "$USE_DATESTAMP" ]; then DATESTAMP="-D '$DATE'" @@ -540,11 +549,13 @@ build_kernel() done $RPMBUILD $targets -bb lustre-kernel-2.4.spec \ + --define "_tmppath $TMPDIR" \ --define "_topdir $TOPDIR" || \ fatal 1 "Error building rpms for $BUILD_ARCHS." if (( $DO_SRC )) ; then $RPMBUILD -bs lustre-kernel-2.4.spec \ + --define "_tmppath $TMPDIR" \ --define "_topdir $TOPDIR" || \ fatal 1 "Error building .src.rpm." fi @@ -569,7 +580,8 @@ build_lustre() ./configure "--with-linux=${LINUX}" ${CONFIGURE_FLAGS} - $RPMBUILD $targets -bb build/lustre.spec \ + $RPMBUILD $targets -bb lustre.spec \ + --define "_tmppath $TMPDIR" \ --define "_topdir $TOPDIR" || \ fatal 1 "Error building rpms for $BUILD_ARCHS." @@ -595,7 +607,7 @@ stage() [ -r ~/.lbuildrc ] && . ~/.lbuildrc -options=$(getopt -o d:D:h -l disable-datestamp,external-patches:,extraversion:,kerneldir:,linux:,lustre:,nodownload,nosrc,publish,release,stage:,tag:,target:,target-archs:,with-linux: -- "$@") +options=$(getopt -o d:D:h -l disable-datestamp,external-patches:,extraversion:,kerneldir:,linux:,lustre:,nodownload,nosrc,publish,release,src,stage:,tag:,target:,target-archs:,with-linux: -- "$@") if [ $? != 0 ] ; then usage 1 @@ -696,55 +708,17 @@ unpack_lustre # prep_build needs the .spec.in from the lustre source if [ -z "$LINUX" ] ; then load_target + if (( $DO_SRC )) ; then + unpack_linux + patch_linux + pack_linux + clean_linux + fi - if [ "$SERIES" ] ; then - if (( $DO_SRC )) ; then - unpack_linux - patch_linux - pack_linux - clean_linux - fi - - prep_kernel_build - clean_lustre + prep_kernel_build + clean_lustre - build_kernel - else - # can't build a kernel if we have no series for it (i.e. patchless) - # but we still need the headers - use_unpacked_source=false - if $use_unpacked_source; then - unpack_linux - LINUX=$(pwd)/linux - pushd $LINUX && { - # need a .config -- like a user would do - BOOTCONFIG="/boot/config-${lnxmaj}-${lnxrel}smp" - if [ -f $BOOTCONFIG ]; then - cp $BOOTCONFIG .config - else - fatal 1 "$BOOTCONFIG doesn't exist! Help!" - fi - # vendors like to taint the EXTRAVERSION in their kernel-source - # to differentiate a user-built kernel from their own - ed << EOF Makefile -/^EXTRAVERSION =/d -wq -EOF - make oldconfig - make include/asm - make include/linux/version.h - make SUBDIRS=scripts - } - popd - else - LINUX=/lib/modules/${lnxmaj}-${lnxrel}smp/build - if [ ! -e $LINUX ]; then - fatal 1 "$LINUX does not exist! Install a kernel-devel package!" - fi - fi - CONFIGURE_FLAGS="CONFIGURE_FLAGS --disable-server" - build_lustre - fi + build_kernel else build_lustre fi