From: adilger Date: Thu, 23 Feb 2006 21:53:34 +0000 (+0000) Subject: Land b_release_1_4_6 onto HEAD (20060223_1429) X-Git-Tag: 1.4.10~359 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=94651e417304eac34b09dbc6001c4ae762c53244;p=fs%2Flustre-release.git Land b_release_1_4_6 onto HEAD (20060223_1429) - for some short time (until libsysio is also merged) some branches will check out the wrong libsysio. Should be fixed before it is noticed. --- diff --git a/build/buildcvs b/build/buildcvs index c580ac6..741a97d 100644 --- a/build/buildcvs +++ b/build/buildcvs @@ -24,47 +24,37 @@ case "$lustretag" in portalstag="b1_2" ;; - b1_4_next_recovery_transno) + b1_4_atime_update) snmptag="HEAD" portalstag="b_hd_newconfig" - lnettag="b_release_1_4_6" - libsysiotag="b_release_1_4_6" + lnettag="b_hd_newconfig" ;; - b1_4_lfs_df) + b1_4_join) snmptag="HEAD" portalstag="b_hd_newconfig" - lnettag="b_release_1_4_6" - libsysiotag="b_release_1_4_6" - ;; - - b1_4_atime_update) + lnettag="b_hd_newconfig" + ;; + + b1_4_lfs_df) snmptag="HEAD" portalstag="b_hd_newconfig" - lnettag="b_release_1_4_6" - libsysiotag="b_release_1_4_6" + lnettag="b_hd_newconfig" ;; b1_4_lov_lvb_cleanup) snmptag="HEAD" portalstag="b_hd_newconfig" - lnettag="b_release_1_4_6" - libsysiotag="b_release_1_4_6" + lnettag="b_hd_newconfig" ;; - - b1_4_rhel4_22) - snmptag="HEAD" - portalstag="b_release_1_4_6" - lnettag="b_release_1_4_6" - ;; - b1_4 | b1_4_*) + b1_4_next_recovery_transno) snmptag="HEAD" portalstag="b_hd_newconfig" lnettag="b_hd_newconfig" - ;; - - b1_4_join) + ;; + + b1_4 | b1_4_*) snmptag="HEAD" portalstag="b_hd_newconfig" lnettag="b_hd_newconfig" @@ -80,16 +70,16 @@ case "$lustretag" in portalstag="$lustretag" ;; - b_ioprovement) - portalstag=b_ioprovement - ;; - b_iam*) snmptag="HEAD" portalstag="b_hd_newconfig" lnettag="b_hd_newconfig" ;; + b_ioprovement) + portalstag="b_ioprovement" + ;; + b_newconfig_rdmarouting) portalstag="b_hd_newconfig" lnettag="b_newconfig_rdmarouting" @@ -123,18 +113,22 @@ case "$lustretag" in portalstag="b_ptlrpc_cleanup" ;; - b_release_*) - portalstag=$lustretag + # starting with 1_4_6, we have a tagged lnet too + b_release_1_4_[6-9]*) + portalstag="$lustretag" + libsysiotag="$lustretag" + lnettag="$lustretag" ;; - RELEASE_1_4_6_B1_4_JOIN_LAND_PARENT_20051208_1641) - lnettag="b_hd_newconfig" - portalstag="b_hd_newconfig" + b_release_*) + portalstag="$lustretag" + libsysiotag="$lustretag" ;; # v1.0-v1.3, v1.4.0-v1.4.2 v1_[0-3]_*|v1_4_[0-2]*) portalstag="$lustretag" + libsysiotag="$lustretag" ;; # v1.4.3-v1.4.5, v1.4.5.1 - v1.4.5.9 diff --git a/build/clearpatches.sh b/build/clearpatches.sh index de31352..a0f5741 100644 --- a/build/clearpatches.sh +++ b/build/clearpatches.sh @@ -1,6 +1,7 @@ -SERIESPATH=./series -PATCHESPATH=./patches -NOUSEPATH=./nousepatches +BASEDIR=${BASEDIR:-lustre/kernel_patches} +SERIESPATH=${SERIESPATH:-$BASEDIR/series} +PATCHESPATH=${PATCHESPATH:-$BASEDIR/patches} +NOUSEPATH=${NOUSEPATH:-$BASEDIR/unused} #mkdir -p $NOUSEPATH for PATCH in `ls $PATCHESPATH | grep -v CVS` ; do diff --git a/build/confirmpatches.sh b/build/confirmpatches.sh index c9cb699..1c160da 100644 --- a/build/confirmpatches.sh +++ b/build/confirmpatches.sh @@ -1,5 +1,6 @@ -SERIESPATH=./series -PATCHESPATH=./patches +BASEDIR=${BASEDIR:-lustre/kernel_patches} +SERIESPATH=${SERIESPATH:-$BASEDIR/series} +PATCHESPATH=${PATCHESPATH:-$BASEDIR/patches} for SERIES in `ls $SERIESPATH | egrep -v "CVS|~$|.orig"` ; do #echo $SERIES for PATCH in `cat $SERIESPATH/$SERIES`; do diff --git a/build/land1.sh b/build/land1.sh index 274eec6..da2df67 100755 --- a/build/land1.sh +++ b/build/land1.sh @@ -93,7 +93,7 @@ $CVS tag ${PARENT}_${CHILD}_LAND_PARENT_$date $dir echo "done" echo -n "Create land point on ${child} ${PARENT}_${CHILD}_LAND_CHILD_$date ..." -$CVS rtag -r ${child} ${PARENT}_${CHILD}_LAND_CHILD_$date $module $dir +$CVS tag -r ${child} ${PARENT}_${CHILD}_LAND_CHILD_$date $dir echo "done" echo -n "Preserve old base tag ${CHILD}_BASE as ${CHILD}_BASE_PREV ..." diff --git a/build/lbuild b/build/lbuild index d6e95ca..daeaa20 100755 --- a/build/lbuild +++ b/build/lbuild @@ -1,5 +1,7 @@ #!/bin/sh +# vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4: + TOPDIR=$PWD # CVSROOT is inherited from the environment @@ -49,10 +51,10 @@ readlink() { local path=$1 ll if [ -L "$path" ]; then - ll="$(LC_ALL=C ls -l "$path" 2> /dev/null)" && - echo "${ll/* -> }" + ll="$(LC_ALL=C ls -l "$path" 2> /dev/null)" && + echo "${ll/* -> }" else - return 1 + return 1 fi } @@ -82,8 +84,8 @@ list_targets() { echo -n "Available targets:" for target in $TOPDIR/lustre/lustre/kernel_patches/targets/*.target ; do - target_file=${target##*/} - echo -n " ${target_file%%.target}" + target_file=${target##*/} + echo -n " ${target_file%%.target}" done echo } @@ -172,60 +174,60 @@ EOF check_options() { if [ "$LUSTRE" ] ; then - [ -r "$LUSTRE" ] || \ - usage 1 "Could not find Lustre source tarball '$LUSTRE'." + [ -r "$LUSTRE" ] || \ + usage 1 "Could not find Lustre source tarball '$LUSTRE'." else - [ "$CVSROOT" ] || \ - usage 1 "Either specify a CVS Root with -d, or a Lustre source tarball with --lustre." - [ "$TAG" ] || \ - usage 1 "A branch/tag name must be specified with --tag when not building from a tarball." + [ "$CVSROOT" ] || \ + usage 1 "Either specify a CVS Root with -d, or a Lustre source tarball with --lustre." + [ "$TAG" ] || \ + usage 1 "A branch/tag name must be specified with --tag when not building from a tarball." fi if [ -z "$LINUX" ] ; then - [ "$KERNELDIR" ] || \ - usage 1 "A kernel directory must be specified with --kerneldir." + [ "$KERNELDIR" ] || \ + usage 1 "A kernel directory must be specified with --kerneldir." - [ -d "$KERNELDIR" ] || \ - usage 1 "$KERNELDIR is not a directory." + [ -d "$KERNELDIR" ] || \ + usage 1 "$KERNELDIR is not a directory." - if ! (( $RELEASE )) ; then - [ "$TAG" ] || \ - usage 1 "When building a snapshot, a tag name must be used." - fi + if ! (( $RELEASE )) ; then + [ "$TAG" ] || \ + usage 1 "When building a snapshot, a tag name must be used." + fi - [ "$TARGET" ] || usage 1 "A target must be specified with --target." + [ "$TARGET" ] || usage 1 "A target must be specified with --target." # TARGET_FILE="$TOPDIR/lustre/kernel_patches/targets/$TARGET.target" # [ -r "$TARGET_FILE" ] || \ -# usage 1 "Target '$TARGET' was not found." +# usage 1 "Target '$TARGET' was not found." fi case $TARGET in - 2.6-rhel4) - CANONICAL_TARGET="rhel-2.6" - ;; - 2.6-suse) - CANONICAL_TARGET="sles-2.6" - ;; - hp_pnnl-2.4) - CANONICAL_TARGET="hp-pnnl-2.4" - ;; - 2.6-vanilla \ - | suse-2.4.21-2 \ - | rh-2.4 \ - | rhel-2.4 \ - | sles-2.4) - CANONICAL_TARGET="$TARGET" - ;; + 2.6-rhel4) + CANONICAL_TARGET="rhel-2.6" + ;; + 2.6-suse) + CANONICAL_TARGET="sles-2.6" + ;; + hp_pnnl-2.4) + CANONICAL_TARGET="hp-pnnl-2.4" + ;; + 2.6-vanilla \ + | suse-2.4.21-2 \ + | rh-2.4 \ + | rhel-2.4 \ + | sles-2.4) + CANONICAL_TARGET="$TARGET" + ;; esac TIMESTAMP=$(date -d "$DATE" "+%Y%m%d%H%M") RPMBUILD=$(which rpmbuild 2>/dev/null | head -1) if [ ! "$RPMBUILD" -o "$RPMBUILD" == "" ]; then - RPMBUILD=$(which rpm 2>/dev/null | head -1) - if [ ! "$RPMBUILD" -o "$RPMBUILD" == "" ]; then - usage 1 "Could not find binary for making rpms (tried rpmbuild and rpm)." - fi + RPMBUILD=$(which rpm 2>/dev/null | head -1) + if [ ! "$RPMBUILD" -o "$RPMBUILD" == "" ]; then + usage 1 "Could not find binary for making rpms (tried rpmbuild and rpm)." + fi fi } @@ -234,49 +236,67 @@ uniqify() echo $(echo "$*" | xargs -n 1 | sort -u) } -download_and_build_tarball() { +build_tarball() { local TARGET=$1 - local KERNEL_FILE=$2 - - local SRPM=kernel-${lnxmaj}-${lnxrel}.src.rpm - - echo "Downloading http://ftp.lustre.org/kernels/$TARGET/old/$SRPM..." - if ! wget -nv "http://ftp.lustre.org/kernels/$TARGET/old/$SRPM" \ - -O "$KERNELDIR/$SRPM" ; then - fatal 1 "Could not download target $TARGET's kernel SRPM $SRPM from ftp.lustre.org." - fi - - if [ "$TARGET" = "rhel-2.6" ]; then - RPMTOPDIR=$(mktemp -d $KERNELDIR/rpm_XXXXXX) - mkdir $RPMTOPDIR/BUILD/ + local SRPM=$2 + + if [ "$TARGET" = "rhel-2.6" -o "$TARGET" = "rhel-2.4" ]; then + local SPEC="" + if [ "$TARGET" = "rhel-2.6" ]; then + SPEC=kernel-2.6.spec + OLDCONFIG=nonint_oldconfig + elif [ "$TARGET" = "rhel-2.4" ]; then + SPEC=kernel-2.4.spec + OLDCONFIG=oldconfig + fi + + RPMTOPDIR=$(mktemp -d $KERNELDIR/rpm_XXXXXX) + mkdir $RPMTOPDIR/BUILD/ rpm -ivh $KERNELDIR/$SRPM --define "_topdir $RPMTOPDIR" || \ - { rm -rf $RPMTOPDIR; fatal 1 "Error installing kernel SRPM."; } - $RPMBUILD -bp --nodeps --target i686 $RPMTOPDIR/SPECS/kernel-2.6.spec --define "_topdir $RPMTOPDIR" + { rm -rf $RPMTOPDIR; fatal 1 "Error installing kernel SRPM."; } + $RPMBUILD -bp --nodeps --target i686 $RPMTOPDIR/SPECS/$SPEC --define "_topdir $RPMTOPDIR" pushd $RPMTOPDIR/BUILD/kernel-${lnxmaj}/linux-${lnxmaj} && { make mrproper cp configs/kernel-${lnxmaj}-i686-smp.config .config - make nonint_oldconfig > /dev/null + if ! make $OLDCONFIG > /dev/null; then + fatal 1 "error trying to make $OLDCONFIG while building a tarball from SRPM." + fi make include/linux/version.h rm -f .config cd .. tar cjf $KERNEL_FILE linux-${lnxmaj} } popd - rm -rf $RPMTOPDIR + rm -rf $RPMTOPDIR + fi +} + +download_and_build_tarball() { + local TARGET=$1 + local KERNEL_FILE=$2 + + local SRPM=kernel-${lnxmaj}-${lnxrel}.src.rpm + + echo "Downloading http://ftp.lustre.org/kernels/$TARGET/old/$SRPM..." + if ! wget -nv "http://ftp.lustre.org/kernels/$TARGET/old/$SRPM" \ + -O "$KERNELDIR/$SRPM" ; then + fatal 1 "Could not download target $TARGET's kernel SRPM $SRPM from ftp.lustre.org." fi + + build_tarball $TARGET $SRPM } load_target() { EXTRA_VERSION_save="$EXTRA_VERSION" for patchesdir in "$EXTERNAL_PATCHES" "$TOPDIR/lustre/lustre/kernel_patches" ; do - TARGET_FILE="$patchesdir/targets/$TARGET.target" - [ -r "$TARGET_FILE" ] && break + TARGET_FILE="$patchesdir/targets/$TARGET.target" + [ -r "$TARGET_FILE" ] && break done [ -r "$TARGET_FILE" ] || \ - fatal 1 "Target $TARGET was not found." + fatal 1 "Target $TARGET was not found." - echo "Loading target config file $TARGET.target..." + echo "Loading target config file $TARGET.target..." . "$TARGET_FILE" @@ -286,39 +306,45 @@ load_target() [ "$VERSION" ] || fatal 1 "Target $TARGET did not specify a kernel version." if [ "$KERNELDIR" ] ; then - KERNEL_FILE="$KERNELDIR/$KERNEL" - if [ ! -r "$KERNELDIR/$KERNEL" ] ; then - if (( $DOWNLOAD )) ; then - echo "Downloading http://ftp.lustre.org/kernels/$CANONICAL_TARGET/old/$KERNEL..." - if ! wget -nv "http://ftp.lustre.org/kernels/$CANONICAL_TARGET/old/$KERNEL" -O "$KERNELDIR/$KERNEL" ; then - # see if we can do it with an SRPM from the download site - download_and_build_tarball $CANONICAL_TARGET $KERNEL_FILE - fi - else - fatal 1 "Target $TARGET's kernel file $KERNEL not found in kernel directory $KERNELDIR." - fi - fi + KERNEL_FILE="$KERNELDIR/$KERNEL" + if [ ! -r "$KERNELDIR/$KERNEL" ] ; then + # see if we have an SRPM we can build a tarball for + KERNEL_SRPM=kernel-${lnxmaj}-${lnxrel}.src.rpm + if [ -r "$KERNELDIR/$KERNEL_SRPM" ] ; then + build_tarball $CANONICAL_TARGET $KERNEL_SRPM + else + if (( $DOWNLOAD )) ; then + echo "Downloading http://ftp.lustre.org/kernels/$CANONICAL_TARGET/old/$KERNEL..." + if ! wget -nv "http://ftp.lustre.org/kernels/$CANONICAL_TARGET/old/$KERNEL" -O "$KERNELDIR/$KERNEL" ; then + # see if we can do it with an SRPM from the download site + download_and_build_tarball $CANONICAL_TARGET $KERNEL_FILE + fi + else + fatal 1 "Target $TARGET's kernel file $KERNEL not found in kernel directory $KERNELDIR." + fi + fi + fi fi if [ "$SERIES" ] ; then for series in $SERIES ; do - for patchesdir in "$EXTERNAL_PATCHES" "$TOPDIR/lustre/lustre/kernel_patches" ; do - [ -r "$patchesdir/series/$series" ] && continue 2 - done - fatal 1 "Target $TARGET's series $SERIES could not be found.\nSearched:\n\t$EXTERNAL_PATCHES/series\n\t$TOPDIR/lustre/lustre/kernel_patches/series." - done + for patchesdir in "$EXTERNAL_PATCHES" "$TOPDIR/lustre/lustre/kernel_patches" ; do + [ -r "$patchesdir/series/$series" ] && continue 2 + done + fatal 1 "Target $TARGET's series $SERIES could not be found.\nSearched:\n\t$EXTERNAL_PATCHES/series\n\t$TOPDIR/lustre/lustre/kernel_patches/series." + done fi CONFIG_FILE="$TOPDIR/lustre/lustre/kernel_patches/kernel_configs/$CONFIG" [ -r "$CONFIG_FILE" ] || \ - fatal 1 "Target $TARGET's config file $CONFIG missing from $TOPDIR/lustre/lustre/kernel_patches/kernel_configs/." + fatal 1 "Target $TARGET's config file $CONFIG missing from $TOPDIR/lustre/lustre/kernel_patches/kernel_configs/." if [ "$EXTRA_VERSION_save" ] ; then - EXTRA_VERSION="$EXTRA_VERSION_save" + 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}" + #remove the @VERSION@ (lustre version) + EXTRA_VERSION=$(echo $EXTRA_VERSION | sed -e "s/\(.*_lustre\)\..*/\1/") + EXTRA_VERSION="${EXTRA_VERSION}-${TAG}.${TIMESTAMP}" fi # EXTRA_VERSION=${EXTRA_VERSION//-/_} @@ -326,9 +352,9 @@ load_target() BUILD_ARCHS= for arch in $(uniqify "$ALL_ARCHS") ; do - if [ -z "$TARGET_ARCHS" ] || echo "$TARGET_ARCHS" | grep "$arch" >/dev/null 2>/dev/null ; then - BUILD_ARCHS="$BUILD_ARCHS $arch" - fi + if [ -z "$TARGET_ARCHS" ] || echo "$TARGET_ARCHS" | grep "$arch" >/dev/null 2>/dev/null ; then + BUILD_ARCHS="$BUILD_ARCHS $arch" + fi done [ "$BUILD_ARCHS" ] || usage 1 "No available target archs to build." echo "Building for: $BUILD_ARCHS" @@ -337,21 +363,21 @@ load_target() tarflags() { case "$1" in - '') - fatal 1 "tarflags(): File name argument missing." - ;; - *.tar.gz | *.tgz) - echo 'zxf' - ;; - *.tar.bz2) - echo 'jxf' - ;; - *.tar) - echo 'xf' - ;; - *) - fatal 1 "tarflags(): Unrecognized tar extension in file: $1" - ;; + '') + fatal 1 "tarflags(): File name argument missing." + ;; + *.tar.gz | *.tgz) + echo 'zxf' + ;; + *.tar.bz2) + echo 'jxf' + ;; + *.tar) + echo 'xf' + ;; + *) + fatal 1 "tarflags(): Unrecognized tar extension in file: $1" + ;; esac } @@ -365,30 +391,30 @@ unpack_lustre() { DIRNAME="lustre-$TAG-$TIMESTAMP" if [ "$LUSTRE" ] ; then - untar "$LUSTRE" - [ -d lustre ] || ln -sf lustre* lustre + untar "$LUSTRE" + [ -d lustre ] || ln -sf lustre* lustre else - if [ "$USE_DATESTAMP" ]; then - DATESTAMP="-D '$DATE'" - else - DATESTAMP="" - fi - - cvs -d "$CVSROOT" -qz3 co $DATESTAMP -d "$DIRNAME" lustre || \ - fatal 1 "There was an error checking out toplevel Lustre from CVS." - pushd "$DIRNAME" > /dev/null - ./lustrecvs "$TAG" || \ - fatal 1 "There was an error checking out Lustre/Portals/Build from CVS." - echo "Creating lustre tarball..." - sh autogen.sh || fatal 1 "There was an error running autogen.sh." - ./configure --disable-{modules,utils,liblustre,tests,doc} || \ - fatal 1 "There was an error running ./configure to create makefiles." - make dist || fatal 1 "There was an error running 'make dist'." - popd > /dev/null - fname=`basename $DIRNAME/lustre-*.tar.gz` - cp $DIRNAME/$fname . || fatal 1 "There was an error copying lustre tarball." - LUSTRE="$PWD/$fname" - ln -sf "$DIRNAME" lustre + if [ "$USE_DATESTAMP" ]; then + DATESTAMP="-D '$DATE'" + else + DATESTAMP="" + fi + + cvs -d "$CVSROOT" -qz3 co $DATESTAMP -d "$DIRNAME" lustre || \ + fatal 1 "There was an error checking out toplevel Lustre from CVS." + pushd "$DIRNAME" > /dev/null + ./lustrecvs "$TAG" || \ + fatal 1 "There was an error checking out Lustre/Portals/Build from CVS." + echo "Creating lustre tarball..." + sh autogen.sh || fatal 1 "There was an error running autogen.sh." + ./configure --disable-{modules,utils,liblustre,tests,doc} || \ + fatal 1 "There was an error running ./configure to create makefiles." + make dist || fatal 1 "There was an error running 'make dist'." + popd > /dev/null + fname=`basename $DIRNAME/lustre-*.tar.gz` + cp $DIRNAME/$fname . || fatal 1 "There was an error copying lustre tarball." + LUSTRE="$PWD/$fname" + ln -sf "$DIRNAME" lustre fi } @@ -405,22 +431,22 @@ patch_linux() [ -f "$FULL_PATCH" ] && rm -f "$FULL_PATCH" pushd linux >/dev/null for series in $SERIES ; do - echo -n "Applying series $series:" - for patchesdir in "$EXTERNAL_PATCHES" "$TOPDIR/lustre/lustre/kernel_patches" ; do - [ -r "$patchesdir/series/$series" ] || continue - SERIES_FILE="$patchesdir/series/$series" - for patch in $(<"$SERIES_FILE") ; do - echo -n " $patch" - PATCH_FILE="$patchesdir/patches/$patch" - [ -r "$PATCH_FILE" ] || \ - fatal 1 "Patch $patch does not exist in Lustre tree." - cat "$PATCH_FILE" >> "$FULL_PATCH" || \ - fatal 1 "Error adding patch $patch to full patch." - patch -s -p1 < "$PATCH_FILE" || fatal 1 "Error applying patch $patch." - done - break - done - echo + echo -n "Applying series $series:" + for patchesdir in "$EXTERNAL_PATCHES" "$TOPDIR/lustre/lustre/kernel_patches" ; do + [ -r "$patchesdir/series/$series" ] || continue + SERIES_FILE="$patchesdir/series/$series" + for patch in $(<"$SERIES_FILE") ; do + echo -n " $patch" + PATCH_FILE="$patchesdir/patches/$patch" + [ -r "$PATCH_FILE" ] || \ + fatal 1 "Patch $patch does not exist in Lustre tree." + cat "$PATCH_FILE" >> "$FULL_PATCH" || \ + fatal 1 "Error adding patch $patch to full patch." + patch -s -p1 < "$PATCH_FILE" || fatal 1 "Error applying patch $patch." + done + break + done + echo done popd >/dev/null echo "Full patch has been saved in ${FULL_PATCH##*/}." @@ -430,11 +456,11 @@ patch_linux() rm -f linux/configs/* copysuccess=0 for patchesdir in "$EXTERNAL_PATCHES" "lustre/lustre/kernel_patches" ; do - [ "$patchesdir" ] && \ - cp -v $patchesdir/kernel_configs/kernel-${VERSION}-${TARGET}*.config linux/configs/ >/dev/null && copysuccess=1 + [ "$patchesdir" ] && \ + cp -v $patchesdir/kernel_configs/kernel-${VERSION}-${TARGET}*.config linux/configs/ >/dev/null && copysuccess=1 done [ "$copysuccess" = "1" ] || \ - fatal 1 "Error copying in kernel configs." + fatal 1 "Error copying in kernel configs." } pack_linux() @@ -442,9 +468,9 @@ pack_linux() TARBALL="$(readlink linux)-$EXTRA_VERSION.tar.gz" echo "Creating patched linux tarball $TARBALL..." tar zcf "$TARBALL" "$(readlink linux)" \ - --exclude "CVS" --exclude ".cvsignore" || \ - --exclude "*.orig" --exclude "*~" --exclude "*.rej" || \ - fatal 1 "Error creating patched Linux tarball." + --exclude "CVS" --exclude ".cvsignore" || \ + --exclude "*.orig" --exclude "*~" --exclude "*.rej" || \ + fatal 1 "Error creating patched Linux tarball." } clean_linux() @@ -460,42 +486,42 @@ prep_kernel_build() # make .spec file ENABLE_INIT_SCRIPTS="" sed \ - -e "s^@BASE_ARCHS@^$BASE_ARCHS^g" \ - -e "s^@BIGMEM_ARCHS@^$BIGMEM_ARCHS^g" \ - -e "s^@BIGSMP_ARCHS@^$BIGSMP_ARCHS^g" \ - -e "s^@BOOT_ARCHS@^$BOOT_ARCHS^g" \ - -e "s^@CONFIGURE_FLAGS@^$CONFIGURE_FLAGS^g" \ - -e "s^@ENABLE_INIT_SCRIPTS@^$ENABLE_INIT_SCRIPTS^g" \ - -e "s^@JENSEN_ARCHS@^$BOOT_ARCHS^g" \ - -e "s^@KERNEL_EXTRA_VERSION@^$EXTRA_VERSION^g" \ - -e "s^@KERNEL_RELEASE@^${EXTRA_VERSION//-/_}^g" \ - -e "s^@KERNEL_SOURCE@^$KERNEL^g" \ - -e "s^@KERNEL_VERSION@^$VERSION^g" \ - -e "s^@LINUX26@^$LINUX26^g" \ - -e "s^@LUSTRE_SOURCE@^${LUSTRE##*/}^g" \ - -e "s^@LUSTRE_TARGET@^$TARGET^g" \ - -e "s^@PSERIES64_ARCHS@^$PSERIES64_ARCHS^g" \ - -e "s^@RHBUILD@^$RHBUILD^g" \ - -e "s^@SMP_ARCHS@^$SMP_ARCHS^g" \ - -e "s^@SUSEBUILD@^$SUSEBUILD^g" \ - -e "s^@SUSEBUILD@^$SUSEBUILD^g" \ - -e "s^@UP_ARCHS@^$UP_ARCHS^g" \ - < $TOPDIR/lustre/build/lustre-kernel-2.4.spec.in \ - > lustre-kernel-2.4.spec + -e "s^@BASE_ARCHS@^$BASE_ARCHS^g" \ + -e "s^@BIGMEM_ARCHS@^$BIGMEM_ARCHS^g" \ + -e "s^@BIGSMP_ARCHS@^$BIGSMP_ARCHS^g" \ + -e "s^@BOOT_ARCHS@^$BOOT_ARCHS^g" \ + -e "s^@CONFIGURE_FLAGS@^$CONFIGURE_FLAGS^g" \ + -e "s^@ENABLE_INIT_SCRIPTS@^$ENABLE_INIT_SCRIPTS^g" \ + -e "s^@JENSEN_ARCHS@^$BOOT_ARCHS^g" \ + -e "s^@KERNEL_EXTRA_VERSION@^$EXTRA_VERSION^g" \ + -e "s^@KERNEL_RELEASE@^${EXTRA_VERSION//-/_}^g" \ + -e "s^@KERNEL_SOURCE@^$KERNEL^g" \ + -e "s^@KERNEL_VERSION@^$VERSION^g" \ + -e "s^@LINUX26@^$LINUX26^g" \ + -e "s^@LUSTRE_SOURCE@^${LUSTRE##*/}^g" \ + -e "s^@LUSTRE_TARGET@^$TARGET^g" \ + -e "s^@PSERIES64_ARCHS@^$PSERIES64_ARCHS^g" \ + -e "s^@RHBUILD@^$RHBUILD^g" \ + -e "s^@SMP_ARCHS@^$SMP_ARCHS^g" \ + -e "s^@SUSEBUILD@^$SUSEBUILD^g" \ + -e "s^@SUSEBUILD@^$SUSEBUILD^g" \ + -e "s^@UP_ARCHS@^$UP_ARCHS^g" \ + < $TOPDIR/lustre/build/lustre-kernel-2.4.spec.in \ + > lustre-kernel-2.4.spec [ -d SRPMS ] || mkdir SRPMS [ -d RPMS ] || mkdir RPMS [ -d BUILD ] || mkdir BUILD [ -d SOURCES ] || mkdir SOURCES for script in linux-{rhconfig.h,merge-config.awk,merge-modules.awk} \ - suse-{functions.sh,post.sh,postun.sh,trigger-script.sh.in} \ - sles8-{pre,post,postun,update_{INITRD_MODULES,rcfile_setting}}.sh ; do - cp $TOPDIR/lustre/build/$script SOURCES + suse-{functions.sh,post.sh,postun.sh,trigger-script.sh.in} \ + sles8-{pre,post,postun,update_{INITRD_MODULES,rcfile_setting}}.sh ; do + cp $TOPDIR/lustre/build/$script SOURCES done cp "$LUSTRE" "$KERNEL_FILE" SOURCES if [ "$EXTERNAL_PATCHES" -a -d "$EXTERNAL_PATCHES" ] ; then - tar zcf SOURCES/external-patches.tar.gz -C "$EXTERNAL_PATCHES" series targets patches kernel_configs + tar zcf SOURCES/external-patches.tar.gz -C "$EXTERNAL_PATCHES" series targets patches kernel_configs else - touch SOURCES/external-patches.tar.gz + touch SOURCES/external-patches.tar.gz fi } @@ -512,17 +538,17 @@ build_kernel() echo "Building kernel + Lustre RPMs for: $BUILD_ARCHS..." targets= for arch in $BUILD_ARCHS ; do - targets="--target $arch $targets" + targets="--target $arch $targets" done $RPMBUILD $targets -bb lustre-kernel-2.4.spec \ - --define "_topdir $TOPDIR" || \ - fatal 1 "Error building rpms for $BUILD_ARCHS." + --define "_topdir $TOPDIR" || \ + fatal 1 "Error building rpms for $BUILD_ARCHS." if (( $DO_SRC )) ; then - $RPMBUILD -bs lustre-kernel-2.4.spec \ - --define "_topdir $TOPDIR" || \ - fatal 1 "Error building .src.rpm." + $RPMBUILD -bs lustre-kernel-2.4.spec \ + --define "_topdir $TOPDIR" || \ + fatal 1 "Error building .src.rpm." fi } @@ -540,14 +566,14 @@ build_lustre() echo "Building Lustre RPMs for: $BUILD_ARCHS..." targets= for arch in $BUILD_ARCHS ; do - targets="--target $arch $targets" + targets="--target $arch $targets" done ./configure "--with-linux=${LINUX}" ${CONFIGURE_FLAGS} $RPMBUILD $targets -bb build/lustre.spec \ - --define "_topdir $TOPDIR" || \ - fatal 1 "Error building rpms for $BUILD_ARCHS." + --define "_topdir $TOPDIR" || \ + fatal 1 "Error building rpms for $BUILD_ARCHS." popd >/dev/null } @@ -557,13 +583,13 @@ stage() [ "$STAGEDIR" ] || return 0 for arch in $BUILD_ARCHS ; do - rpmdir="${STAGEDIR}/${CANONICAL_TARGET}-${arch}" - echo "${0##*/}: Copying RPMs into ${rpmdir}" - mkdir -p "${rpmdir}" - cp -v RPMS/${arch}/*.rpm "${rpmdir}" - if [ -d RPMS/noarch ] ; then - cp -v RPMS/noarch/*.rpm "${rpmdir}" - fi + rpmdir="${STAGEDIR}/${CANONICAL_TARGET}-${arch}" + echo "${0##*/}: Copying RPMs into ${rpmdir}" + mkdir -p "${rpmdir}" + cp -v RPMS/${arch}/*.rpm "${rpmdir}" + if [ -d RPMS/noarch ] ; then + cp -v RPMS/noarch/*.rpm "${rpmdir}" + fi done cp -v "$LUSTRE" "$STAGEDIR" @@ -581,87 +607,87 @@ eval set -- "$options" while [ "$1" ] ; do case "$1" in - '') - usage 1 - ;; - -d) - CVSROOT=$2 - shift 2 - ;; - -D) - DATE=$2 - shift 2 - ;; - --external-patches) - EXTERNAL_PATCHES=$2 - shift 2 - ;; - --extraversion) - EXTRA_VERSION=$2 - shift 2 - ;; - --help | -h) - usage 0 - ;; - --kerneldir) - KERNELDIR=$2 - shift 2 - ;; - --linux | --with-linux) - LINUX=$2 - shift 2 - ;; - --lustre) - LUSTRE=$2 - shift 2 - ;; - --nodownload) - DOWNLOAD=0 - shift 1 - ;; - --nosrc) - DO_SRC=0 - shift 1 - ;; - --publish) - shift - ;; - --release) - RELEASE=1 - shift - ;; - --src) - DO_SRC=1 - shift 1 - ;; - --stage) - STAGEDIR=$2 - shift 2 - ;; - --tag) - TAG=$2 - shift 2 - ;; - --target) - TARGET=$2 - shift 2 - ;; - --target-archs) - TARGET_ARCHS=$2 - shift 2 - ;; - --disable-datestamp) - USE_DATESTAMP= - shift - ;; - --) - shift - CONFIGURE_FLAGS=$@ - break - ;; - *) - usage 1 "Unrecognized option: $1" - ;; + '') + usage 1 + ;; + -d) + CVSROOT=$2 + shift 2 + ;; + -D) + DATE=$2 + shift 2 + ;; + --external-patches) + EXTERNAL_PATCHES=$2 + shift 2 + ;; + --extraversion) + EXTRA_VERSION=$2 + shift 2 + ;; + --help | -h) + usage 0 + ;; + --kerneldir) + KERNELDIR=$2 + shift 2 + ;; + --linux | --with-linux) + LINUX=$2 + shift 2 + ;; + --lustre) + LUSTRE=$2 + shift 2 + ;; + --nodownload) + DOWNLOAD=0 + shift 1 + ;; + --nosrc) + DO_SRC=0 + shift 1 + ;; + --publish) + shift + ;; + --release) + RELEASE=1 + shift + ;; + --src) + DO_SRC=1 + shift 1 + ;; + --stage) + STAGEDIR=$2 + shift 2 + ;; + --tag) + TAG=$2 + shift 2 + ;; + --target) + TARGET=$2 + shift 2 + ;; + --target-archs) + TARGET_ARCHS=$2 + shift 2 + ;; + --disable-datestamp) + USE_DATESTAMP= + shift + ;; + --) + shift + CONFIGURE_FLAGS=$@ + break + ;; + *) + usage 1 "Unrecognized option: $1" + ;; esac done @@ -674,10 +700,10 @@ if [ -z "$LINUX" ] ; then load_target if (( $DO_SRC )) ; then - unpack_linux - patch_linux - pack_linux - clean_linux + unpack_linux + patch_linux + pack_linux + clean_linux fi prep_kernel_build diff --git a/build/lustre.spec.in b/build/lustre.spec.in index 583c895..3d81a29 100644 --- a/build/lustre.spec.in +++ b/build/lustre.spec.in @@ -167,21 +167,26 @@ if [ -f /boot/System.map-%{kversion} ]; then else depmod -ae %{kversion} || exit 0 fi -for ext in .local "" ; do - f=/etc/modprobe.conf$ext - if [ -f $f ] && ! grep llite $f >/dev/null 2>/dev/null ; then - cat >> $f </dev/null 2>/dev/null ; then + cat >> $f <<-EOF alias lustre llite EOF - break + fi + if egrep "^[^#]*(add below|install) ptlrpc" $f ; then + [ ! -f $f.rpmsave ] && cp $f $f.rpmsave + TMPFILE=`mktemp $f.XXXXXX` && \ + sed -e "s/^[^#]*\(add below\|install\) ptlrpc.*/#&/" $f > $TMPFILE && \ + mv $TMPFILE $f + fi fi done -f=/etc/modules.conf -if [ -f $f ] && ! grep llite $f >/dev/null 2>/dev/null ; then - cat >> $f <