download_rdac() {
local force="${1:-false}"
- local location="http://downloads.lustre.org/public/RDAC/"
+ local location="http://downloads.lustre.org/public/RDAC/"
if [ -z "$RDAC_VERSION" -o "$RDAC_VERSION" = "inkernel" ]; then
- return 0
+ return 0
fi
local file="rdac-LINUX-${RDAC_VERSION}-source.tar.gz"
download_mptlinux() {
local force="${1:-false}"
- local location="http://downloads.lustre.org/public/MPTLINUX/"
+ local location="http://downloads.lustre.org/public/MPTLINUX/"
if [ -z "$MPTLINUX_VERSION" -o "$MPTLINUX_VERSION" = "inkernel" ]; then
- return 0
+ return 0
fi
file="MPTLINUX_RHEL5_SLES10_PH15-${MPTLINUX_VERSION}.zip"
# convert the $PATCHLESS boolean to an empty/no-empty boolean
# as silly as this seems, it makes the syntax of the rpmbuild command
- # simpler and not need an eval to deal with the quotes in the quotes
+ # simpler and not need an eval to deal with the quotes in the quotes
local is_patchless=""
if $PATCHLESS; then
is_patchless="yes"
error "Failed to copy \"$article\" to \"$location\" in store_for_reuse()"
# rename the cache location so that it's not cached
# product, but is around for analysis
- mv "$location"{,-bad-$(date +%s)} ||
+ mv "$location"{,-bad-$(date +%s)} ||
error "failed to clean up a failed cache attempt" \
"in \"$location\" -- manual cleanup will be" \
"necessary"
if [ ! -f "$REUSEBUILD/$signature/$module/.lastused" ]; then
# the .lastused flag is populated at the end of the caching to
# 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)} ||
+ # 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"
find $dir -type f |
xargs ln -t $dest/RPMS/${dir##*/} -s
done
-
+
fi
return 0
else
if $NORPM; then
rpmbuildopt='-bc'
echo NORPM mode. Only compiling.
- fi
+ fi
# if only we could just rebuild the src.rpm. but the included spec
# is a real pig's breakfast. just check out the patch we need to
cat "${linux}/include/linux/autoconf.h"; } |
md5sum | cut -d" " -f1)
if ! $REUSERPM || ! reuse ofed "$TOPDIR" "$CAN_LINK_FOR_REUSE" \
- "$REUSE_SIGNATURE"; then
- # stash away the existing built articles for a moment
- mkdir bak
- mv {BUILD,{S,}RPMS,S{OURCE,PEC}S} bak
- function mv_back {
- pushd bak
- find . | cpio -pudlm ..
- popd
- rm -rf bak
- }
- create_rpmbuild_dirs
- # build it
+ "$REUSE_SIGNATURE"; then
+ # stash away the existing built articles for a moment
+ mkdir bak
+ mv {BUILD,{S,}RPMS,S{OURCE,PEC}S} bak
+ function mv_back {
+ pushd bak
+ find . | cpio -pudlm ..
+ popd
+ rm -rf bak
+ }
+ create_rpmbuild_dirs
+ # build it
build_kernel_ib "${linux}"
- if ! store_for_reuse "$TOPDIR/{SPECS,SOURCES,BUILD,SRPMS,RPMS}" \
- "ofed" "$REUSEBUILD" "$REUSE_SIGNATURE" \
- "$CAN_LINK_FOR_REUSE"; then
- error "Failed to store OFED RPMS for reuse"
- mv_back
- return 1
- fi
- # put the stuff we stashed away back
+ if ! store_for_reuse "$TOPDIR/{SPECS,SOURCES,BUILD,SRPMS,RPMS}" \
+ "ofed" "$REUSEBUILD" "$REUSE_SIGNATURE" \
+ "$CAN_LINK_FOR_REUSE"; then
+ error "Failed to store OFED RPMS for reuse"
mv_back
+ return 1
fi
+ # put the stuff we stashed away back
+ mv_back
+ fi
- pushd "$TOPDIR" >/dev/null
- rm -rf kernel-ib-devel
- mkdir kernel-ib-devel
- cd kernel-ib-devel
- # the actual ofed RPMs don't have the -rc$n or -$date string appened that
- # might be present on the file
- local linuxrelease=$(find_linux_release "$linux")
- ofed_version=$(echo $ofed_version |
- sed -re 's/-(20[0-9]{6,6}-[0-9]{4,4}|rc[0-9]*)$//')
- local rpm=$(ls $TOPDIR/RPMS/*/kernel-ib-devel-${ofed_version}-${linuxrelease//-/_}.*.rpm)
- rpm2cpio -itv < $rpm | cpio -id
- CONFIGURE_FLAGS="--with-o2ib=$(pwd)/usr/src/ofa_kernel ${CONFIGURE_FLAGS}"
- popd >/dev/null
+ pushd "$TOPDIR" >/dev/null
+ rm -rf kernel-ib-devel
+ mkdir kernel-ib-devel
+ cd kernel-ib-devel
+ # the actual ofed RPMs don't have the -rc$n or -$date string appened that
+ # might be present on the file
+ local linuxrelease=$(find_linux_release "$linux")
+ ofed_version=$(echo $ofed_version |
+ sed -re 's/-(20[0-9]{6,6}-[0-9]{4,4}|rc[0-9]*)$//')
+ local rpm=$(ls $TOPDIR/RPMS/*/kernel-ib-devel-${ofed_version}-${linuxrelease//-/_}.*.rpm)
+ rpm2cpio -itv < $rpm | cpio -id
+ CONFIGURE_FLAGS="--with-o2ib=$(pwd)/usr/src/ofa_kernel ${CONFIGURE_FLAGS}"
+ popd >/dev/null
}
build_ofed "${LINUXOBJ:-$LINUX}" "$OFED_VERSION" ||
fatal 1 "error building OFED"
- build_rdac "${LINUXOBJ:-$LINUX}" "$RDAC_VERSION" ||
- fatal 1 "error building RDAC"
+ if ! $PATCHLESS; then
+ # only need RDAC for the server
+ build_rdac "${LINUXOBJ:-$LINUX}" "$RDAC_VERSION" ||
+ fatal 1 "error building RDAC"
+ fi
build_mptlinux "${LINUXOBJ:-$LINUX}" "$MPTLINUX_VERSION" ||
fatal 1 "error building mptlinux"
fatal 1 "error building mptlinux"
build_ofed "${LINUXOBJ:-$LINUX}" "$OFED_VERSION" ||
fatal 1 "error building OFED"
- build_rdac "${LINUXOBJ:-$LINUX}" "$RDAC_VERSION" ||
- fatal 1 "error building RDAC"
+ if ! $PATCHLESS; then
+ build_rdac "${LINUXOBJ:-$LINUX}" "$RDAC_VERSION" ||
+ fatal 1 "error building RDAC"
+ fi
build_lustre "$LINUX" "$LINUXOBJ"
else
if [ -f "${0%/*}/lbuild-$DISTRO" ]; then