Path to an existing lustre source tarball to use.
--nodownload
- Do not try to download a kernel from downloads.lustre.org
+ Do not try to download a kernel from downloads.hpdd.intel.com
--nosrc
Do not build a .src.rpm, a full kernel patch, or a patched kernel
if [ -z "$DISTRO" ] ; then
DISTRO=$(autodetect_distro)
- # remove minor version only for rhel and oel
- [[ $DISTRO =~ "el-" ]] && DISTRO=${DISTRO%%.*}
# remove separator
DISTRO=${DISTRO/-/}
fi
+ DISTROMAJ=${DISTRO%%.*}
[ -z "$TARGET" ] && TARGET=$(autodetect_target "$DISTRO")
fi
case $TARGET in
+ 3.10-rhel7)
+ CANONICAL_TARGET="rhel7"
+ ;;
2.6-rhel6)
CANONICAL_TARGET="rhel6"
;;
if $force || [ ! -r "$KERNELDIR/$srpm" ] ||
[ ! -s "$KERNELDIR/$srpm" ]; then
if $DOWNLOAD; then
- local location="http://downloads.lustre.org/public/kernels/$target/old"
+ local location="https://downloads.hpdd.intel.com/public/kernels/$target/old"
# get the location from a distro specific method if it exists
if type -p kernel_srpm_location; then
location=$(kernel_srpm_location)
[ ! -s "$KERNELDIR/$srpm" ]; then
rm -f $KERNELDIR/$srpm
# punt to a distro specific method if it exists
- if ! type -p download_srpm-$DISTRO; then
+ if ! type -p download_srpm-$DISTROMAJ; then
fatal 1 "Could not download target $target's kernel SRPM $srpm from $location."
else
- if ! download_srpm-$DISTRO "$target" "$srpm" "$force"; then
- fatal 1 "Could not download target $target's kernel SRPM $srpm using download_srpm-$DISTRO."
+ if ! download_srpm-$DISTROMAJ "$target" "$srpm" "$force"; then
+ fatal 1 "Could not download target $target's kernel SRPM $srpm using download_srpm-$DISTROMAJ."
fi
fi
fi
tarflags() {
local file="$1"
+ echo -n '--wildcards '
case "$file" in
'')
fatal 1 "tarflags(): File name argument missing."
;;
*.tar.gz | *.tgz)
- echo 'zxf'
+ echo '-zxf'
;;
*.tar.bz2)
- echo 'jxf'
+ echo '-jxf'
;;
*.tar)
- echo 'xf'
+ echo '-xf'
;;
*)
fatal 1 "tarflags(): Unrecognized tar extension in file: $1"
}
build_lustre_dkms() {
+ [ -n "$MPSS_VERSION" ] && return 0
local ver=$(eval echo $(awk '/LUSTRE_VERSION_STRING/ {print $3}' lustre/include/lustre_ver.h))
echo "Building Lustre DKMS RPMs for: $BUILD_ARCHS..."
./configure --enable-dist || return 255
fi
# call a distro specific hook, if available
- if type -p unpack_linux_devel_rpm-$DISTRO; then
- if ! unpack_linux_devel_rpm-$DISTRO "$kernelrpm"; then
+ if type -p unpack_linux_devel_rpm-$DISTROMAJ; then
+ if ! unpack_linux_devel_rpm-$DISTROMAJ "$kernelrpm"; then
return 255
fi
fi
if $USE_BUILD_CACHE && [ -n "$REUSEBUILD" ]; then
local REUSE_SIGNATURE=$({ echo -en $release_str;
echo $BUILD_GEN;
- cat $CONFIG_FILE $TARGET_FILE $FULL_PATCH;
- cat $LBUILD_DIR/lbuild $LBUILD_DIR/lbuild-${DISTRO}; } |
+ cat "$CONFIG_FILE";
+ cat "$TARGET_FILE";
+ cat "$FULL_PATCH";
+ cat "$LBUILD_DIR/lbuild";
+ cat "$LBUILD_DIR/lbuild-$DISTROMAJ"; } |
md5sum | cut -d" " -f1)
# see if we can link to the reuse pool
# XXX - hrm. i'm not convinced this doesn't belong in the reuse
# XXX we need to better integrate a distro specific override with
# the rest of this function so that all of the reuse cache
# stuff is leveraged given that 80% of this function is reuse
- if type -p build_ofed-${DISTRO}; then
+ if type -p build_ofed-$DISTROMAJ; then
local ofed_location
- ofed_location=$(build_ofed-${DISTRO} ${STDOUT})
+ ofed_location=$(build_ofed-$DISTROMAJ ${STDOUT})
local rc=${PIPESTATUS[0]}
CONFIGURE_FLAGS="--with-o2ib=${ofed_location} ${CONFIGURE_FLAGS}"
return $rc
echo "$(find_linux_release;
echo "$BUILD_GEN")";
cat "${linux}/include/linux/autoconf.h";
- cat "$LBUILD_DIR/lbuild" ;
- cat "$LBUILD_DIR/lbuild-${DISTRO}"; } |
+ cat "$LBUILD_DIR/lbuild";
+ cat "$LBUILD_DIR/lbuild-$DISTROMAJ"; } |
md5sum | cut -d" " -f1)
# see if we can link to the reuse pool
# XXX - hrm. i'm not convinced this doesn't belong in the reuse
# client build
local kernelrpm
if ! kernelrpm=$(find_linux_rpm "-$DEVEL_KERNEL_TYPE"); then
- fatal 1 "Could not find the kernel-$DEVEL_KERNEL_TYPE RPM in ${KERNELRPMSBASE}/${lnxmaj}/${DISTRO}"
+ fatal 1 "Could not find the kernel-$DEVEL_KERNEL_TYPE RPM in $KERNELRPMSBASE/$lnxmaj/$DISTROMAJ"
fi
if ! lnxrel="$lnxrel" unpack_linux_devel_rpm "$kernelrpm" "-"; then
fatal 1 "Could not find the Linux tree in $kernelrpm"
# XXX - should we _always_ get the buildid from the META file? what are the
# other (i.e. non-lustre-tarball use cases of lbuild)?
-BUILDID=$(sed -ne '/^BUILDID =/s/.*= *//p' lustre/META)
-VERSION=$(sed -ne '/^VERSION =/s/.*= *//p' lustre/META)
+BUILDID=$(sed -n -e 's/^BUILDID = //p' lustre/META)
load_target
if [ "$MPSS_VERSION" = "last" ]; then
MPSS_VERSION=$(parse_mpss_info "$MPSS_INFO" "" ${MPSS_DISTRO})
- [ -z "$MPSS_VERSION" ] && fatal 1 "Could not determine the last MPSS version"
- elif [[ $MPSS_VERSION != [0-9].[0-9].[0-9]*-[0-9]* ]]; then
- fatal 1 "Incorrect MPSS version $MPSS_VERSION"
+ [ -z "$MPSS_VERSION" ] &&
+ fatal 1 "Could not determine the last MPSS version"
fi
download_mpss "$MPSS_INFO"
if [ "${MPSS_VERSION%%.*}" = "3" ]; then
CC_TARGET_ARCH=k1om-mpss-linux
LINUX="$TOPDIR/mpss"
+ RPMBUILD_DEFS="$RPMBUILD_DEFS --define \"cross_requires /bin/sh\""
else
CC_TARGET_ARCH=x86_64-k1om-linux
LINUX="$TOPDIR/mpss/card/kernel"
RPMBUILD_DEFS="$RPMBUILD_DEFS --define \"cross_requires intel-mic-gpl = ${MPSS_VERSION%%-*}\""
fi
+ LUSTRE_VERSION=$(sed -n -e 's/^VERSION = //p' lustre/META)
CONFIGURE_FLAGS="$CONFIGURE_FLAGS $MPSS_OFED --host=$CC_TARGET_ARCH --build=x86_64-pc-linux"
RPMBUILD_DEFS="$RPMBUILD_DEFS --define \"post_script build/gen_filelist.sh\""
RPMBUILD_DEFS="$RPMBUILD_DEFS --define \"make_args ARCH=k1om CROSS_COMPILE=${CC_TARGET_ARCH}-\""
- RPMBUILD_DEFS="$RPMBUILD_DEFS --define \"cross_path ${CROSS_PATH:=/opt/lustre/${VERSION}/${CC_TARGET_ARCH}}\""
+ RPMBUILD_DEFS="$RPMBUILD_DEFS --define \"cross_path ${CROSS_PATH:=/opt/lustre/${LUSTRE_VERSION}/${CC_TARGET_ARCH}}\""
RPMBUILD_DEFS="$RPMBUILD_DEFS --define \"rootdir %{cross_path}\""
RPMBUILD_DEFS="$RPMBUILD_DEFS --define \"_prefix %{cross_path}/usr\""
RPMBUILD_DEFS="$RPMBUILD_DEFS --define \"_mandir %{_prefix}/share/man\""
fatal 1 "error building OFED"
build_lustre "$LINUX" "$LINUXOBJ"
else
- if [ ! -f "${LBUILD_DIR}/lbuild-$DISTRO" ]; then
- fatal 1 "${LBUILD_DIR}/lbuild-$DISTRO not found"
+ if [ ! -f "${LBUILD_DIR}/lbuild-$DISTROMAJ" ]; then
+ fatal 1 "${LBUILD_DIR}/lbuild-$DISTROMAJ not found"
fi
- source ${LBUILD_DIR}/lbuild-$DISTRO
+ source ${LBUILD_DIR}/lbuild-$DISTROMAJ
build_with_srpm || fatal 1 "Failed to build_with_srpm"
fi