sed -e 's/^[^0-9.]*//g' | sed -e 's/[ \.].*//')
fi
if [ -z "$name" -o -z "$version" ]; then
- fatal 1 "I don't know how to determine distro type/version.\n" \
- "Either update autodetect_distro() or use the --distro argument"
+ fatal 1 "I don't know how to determine distro type/version.\nEither update autodetect_distro() or use the --distro argument"
fi
echo ${name}${version}
if ! wget -nv "$location/$srpm" -O "$KERNELDIR/$srpm" ||
[ ! -s "$KERNELDIR/$srpm" ]; then
rm -f $KERNELDIR/$srpm
- fatal 1 "Could not download target $target's kernel SRPM" \
- "$srpm from $location."
+ fatal 1 "Could not download target $target's kernel SRPM $srpm from $location."
fi
else
fatal 1 "$srpm not found in directory $KERNELDIR."
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."
+ 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
PRISTINE_EXTRA_VERSION=$EXTRA_VERSION
if ! $PATCHLESS && [ ! -f "$CONFIG_FILE" ]; then
- fatal 1 "Config file for target $TARGET missing from" \
- "$TOPDIR/lustre/lustre/kernel_patches/kernel_configs/."
+ fatal 1 "Config file for target $TARGET missing from $TOPDIR/lustre/lustre/kernel_patches/kernel_configs/."
fi
if [ "$EXTRA_VERSION_save" ]; then
fi
local linuxrelease=$(find_linux_release "$linux")
- $RPMBUILD $BUILD_TYPE --define 'build_kernel_ib 1' --define 'build_kernel_ib_devel 1' \
- --define "_topdir ${TOPDIR}" --target ${TARGET_ARCH} \
- --define "KVERSION ${linuxrelease}" \
- --define "$K_SRC ${linux}" \
- --define "LIB_MOD_DIR /lib/modules/${linuxrelease}/updates" \
- ${OFA_KERNEL_RELEASE:+--define "_release $OFA_KERNEL_RELEASE"} \
- --define "configure_options --without-quilt $OFED_CORE $OFED_HARDWARE $OFED_ISCSI" \
- ${SOURCE}
-
- if [ ${PIPESTATUS[0]} != 0 ]; then
+ if ! $RPMBUILD $BUILD_TYPE --define 'build_kernel_ib 1' --define 'build_kernel_ib_devel 1' \
+ --define "_topdir ${TOPDIR}" --target ${TARGET_ARCH} \
+ --define "KVERSION ${linuxrelease}" \
+ --define "$K_SRC ${linux}" \
+ --define "LIB_MOD_DIR /lib/modules/${linuxrelease}/updates" \
+ ${OFA_KERNEL_RELEASE:+--define "_release $OFA_KERNEL_RELEASE"} \
+ --define "configure_options --without-quilt $OFED_CORE $OFED_HARDWARE $OFED_ISCSI" \
+ ${SOURCE} 2>&1; then
fatal 1 "Error building kernel-ib"
fi
# signal that the caching was completed. if that flag is not
# there, then the cache is invalid (and should be removed in fact)
mv "$REUSEBUILD/$signature/$module"{,-bad-$(date +%s)} ||
- fatal 1 "failed to clean up a bad cache in location" \
- "\"$REUSEBUILD/$signature/$module\" -- manual cleanup" \
- "will be necessary"
+ fatal 1 "failed to clean up a bad cache in location $REUSEBUILD/$signature/$module\" -- manual cleanup will be necessary"
return 1
fi
[ -r ~/.lbuildrc ] && . ~/.lbuildrc
-options=$(getopt -o d:D:h -l kerneltree:,distro:,kernelrpm:,reusebuild:,patchless,ldiskfs,ccache,reuse:,norpm,disable-datestamp,external-patches:,timestamp:,extraversion:,kerneldir:,linux:,lustre:,nodownload,nosrc,ofed-version:,publish,release,src,stage:,tag:,target:,target-archs:,with-linux:,xen -- "$@")
+options=$(getopt -o d:D:h -l kerneltree:,distro:,kernelrpm:,reusebuild:,patchless,ldiskfs,ccache,reuse:,norpm,disable-datestamp,external-patches:,timestamp:,extraversion:,kerneldir:,linux:,lustre:,nodownload,nosrc,ofed-version:,publish,release,set-value:,src,stage:,tag:,target:,target-archs:,with-linux:,xen -- "$@")
if [ $? != 0 ]; then
usage 1
XEN=true
shift
;;
+ --set-value)
+ eval $2
+ shift 2
+ ;;
--)
shift
CONFIGURE_FLAGS=$@
pack_linux() {
TARBALL="$(readlink linux)-$EXTRA_VERSION.tar.gz"
echo "Creating patched linux tarball $TARBALL..."
- tar zcf "$TARBALL" "$(readlink linux)" \
- --exclude "CVS" --exclude ".cvsignore" || \
+ tar -zcf "$TARBALL" "$(readlink linux)" \
+ --exclude "CVS" --exclude ".cvsignore" \
--exclude "*.orig" --exclude "*~" --exclude "*.rej" || \
fatal 1 "Error creating patched Linux tarball."
}
< $ldiskfs_spec \
> ../lustre-ldiskfs.spec
- $RPMBUILD $targets $rpmbuildopt ../lustre-ldiskfs.spec \
- --define "_tmppath /var/tmp" \
- --define "_topdir $TOPDIR"
- if [ "$?" != "0" ] ; then
+ if ! $RPMBUILD $targets $rpmbuildopt ../lustre-ldiskfs.spec \
+ --define "_tmppath /var/tmp" \
+ --define "_topdir $TOPDIR" 2>&1; then
popd
return 255
fi
if $DO_SRC; then
- $RPMBUILD -bs ../lustre-ldiskfs.spec \
- --define "_tmppath /var/tmp" \
- --define "_topdir $TOPDIR"
- if [ "$?" != "0" ] ; then
+ if ! $RPMBUILD -bs ../lustre-ldiskfs.spec \
+ --define "_tmppath /var/tmp" \
+ --define "_topdir $TOPDIR" 2>&1; then
popd
return 255
fi
if [ "$OFED_VERSION" = "1.3" ]; then
K_SRC="KSRC"
fi
- $RPMBUILD --rebuild --define 'build_kernel_ib 1' --define 'build_kernel_ib_devel 1' \
- --define "_topdir $(lbuild_topdir)" --target ${TARGET_ARCH} \
- --define "KVERSION ${FULL_VERSION}" \
- --define "$K_SRC ${PWD}/linux" \
- --define "LIB_MOD_DIR /lib/modules/${FULL_VERSION}" \
- --define "configure_options --without-quilt --with-core-mod --with-user_mad-mod --with-user_access-mod --with-addr_trans-mod --with-srp-target-mod --with-core-mod --with-mthca-mod --with-mlx4-mod --with-cxgb3-mod --with-nes-mod --with-ipoib-mod --with-sdp-mod --with-srp-mod --with-rds-mod --with-iser-mod --with-qlgc_vnic-mod --with-madeye-mod $configure_options" $(lbuild_topdir)/OFED/SRPMS/ofa_kernel-*.src.rpm
-
- if [ ${PIPESTATUS[0]} != 0 ]; then
+ if ! $RPMBUILD --rebuild --define 'build_kernel_ib 1' --define 'build_kernel_ib_devel 1' \
+ --define "_topdir $(lbuild_topdir)" --target ${TARGET_ARCH} \
+ --define "KVERSION ${FULL_VERSION}" \
+ --define "$K_SRC ${PWD}/linux" \
+ --define "LIB_MOD_DIR /lib/modules/${FULL_VERSION}" \
+ --define "configure_options --without-quilt --with-core-mod --with-user_mad-mod --with-user_access-mod --with-addr_trans-mod --with-srp-target-mod --with-core-mod --with-mthca-mod --with-mlx4-mod --with-cxgb3-mod --with-nes-mod --with-ipoib-mod --with-sdp-mod --with-srp-mod --with-rds-mod --with-iser-mod --with-qlgc_vnic-mod --with-madeye-mod $configure_options" $(lbuild_topdir)/OFED/SRPMS/ofa_kernel-*.src.rpm 2>&1; then
fatal 1 "Error building kernel-ib"
fi
$RPMBUILD --target ${TARGET_ARCH} -bb lustre.spec \
${PATCHLESS:+--define "lustre_name lustre-client"} \
--define "_tmppath $TMPDIR" \
- --define "_topdir $(lbuild_topdir)" || \
+ --define "_topdir $(lbuild_topdir)" 2>&1 || \
fatal 1 "Error building Lustre rpms."
# $MAKE_J "$MAKE_CC" || fatal 1 "Error building Lustre."
popd >/dev/null
if [ "$OFED_VERSION" = "inkernel" ]; then
CONFIGURE_FLAGS="--with-o2ib=yes ${CONFIGURE_FLAGS}"
else
- build_kernel_ib
+ build_kernel_ib
fi
fi