SPLZFSTAG=${SPLZFSTAG:-lustre-zfs}
# The files expect a kver to be set to the kernel version .
- local kver=$(find_linux_release ${LINUX})
+ local kver=$(find_linux_release)
# build and install the spl and zfs (and -devel) RPMs for lustre to use
local pkg
sh autogen.sh || return 255
- if ! ./configure --with-linux=${LINUX} --with-linux-obj=${LINUX} \
+ if ! ./configure --with-linux=${LINUX} --with-linux-obj=${LINUXOBJ:-$LINUX} \
${spldir:+--with-spl="${spldir}"} 2>&1 ||
! make dist 2>&1; then
popd
--define "kver $kver" \
--define "kernels $kver" \
--define "_tmppath /var/tmp" \
- --define "kernelbuildroot $(find_linux_builddir $LINUX)" \
+ --define "kernelbuildroot $TOPDIR/reused" \
--define "_topdir $TOPDIR" 2>&1; then
return 255
fi
}
-# This function takes a linux source pool and digs out the linux release
-# from it
-find_linux_release() {
- local SRCDIR="$1"
+# This function takes a linux include tree and digs out the linux release
+# from it. It is never called directly, only called from the distro
+# specific function find_linux_release() in lbuild-{rhel,sles}.
+_find_linux_release() {
+ local SRC="$1"
+ local LINUXRELEASEHEADER=""
- local LINUXRELEASEHEADER=$SRCDIR/include/linux/version.h
- if [ -s $SRCDIR/include/linux/utsrelease.h ]; then
- LINUXRELEASEHEADER=$SRCDIR/include/linux/utsrelease.h
+ LINUXRELEASEHEADER=$SRC/include/linux/version.h
+ if [ -s $SRC/include/generated/utsrelease.h ]; then
+ LINUXRELEASEHEADER=$SRC/include/generated/utsrelease.h
+ elif [ -s $SRC/include/linux/utsrelease.h ]; then
+ LINUXRELEASEHEADER=$SRC/include/linux/utsrelease.h
fi
- sed -ne 's/#define UTS_RELEASE "\(.*\)"$/\1/p' $LINUXRELEASEHEADER
-}
-
-# This funcition finds the buildroot directory for a given linux
-# kernel directory
-find_linux_builddir() {
- local linux=${1:-${LINUX}}
- local rel=$(find_linux_release $linux)
+ if [ ! -s $LINUXRELEASEHEADER ]; then
+ fatal 1 "could not find UTS_RELEASE"
+ fi
- echo ${linux%/usr/src/kernels/${rel}*}
+ sed -ne 's/#define UTS_RELEASE "\(.*\)"$/\1/p' $LINUXRELEASEHEADER
}
# unpack kernel(/source/devel) RPM
fi
fi
- local linuxrelease=$(find_linux_release "$linux")
+ local linuxrelease=$(find_linux_release)
if compare_version $OFED_VERSION 3.0; then
local OFA_KERNEL_RELEASE=$(echo -n ${linuxrelease} | sed -e 's/-/_/g')
fi
# figure out the EXTRA_VERSION of the kernel we built or are re-using
local KERNEL_RPM
- if ! KERNEL_RPM=$(find_rpm "$TOPDIR/RPMS/$TARGET_ARCH/" provides "^kernel ="); then
+ if ! KERNEL_RPM=$(find_rpm "$TOPDIR/RPMS/$TARGET_ARCH/" provides "^kernel(-default)? ="); then
fatal 1 "Failed to find a kernel RPM in $TOPDIR/RPMS/$TARGET_ARCH/"
fi
kernel_extra_version=$(rpm -q --queryformat "%{RELEASE}" -p $TOPDIR/RPMS/$TARGET_ARCH/$KERNEL_RPM)
# build kernel-ib/compat-rdma
if $USE_BUILD_CACHE && [ -n "$REUSEBUILD" ]; then
local REUSE_SIGNATURE=$({ echo "$ofed_version";
- echo "$(find_linux_release ${linux};
+ echo "$(find_linux_release;
echo "$BUILD_GEN")";
cat "${linux}/include/linux/autoconf.h";
cat "${0%/lbuild}/lbuild" ;
cd ${kib_rpm}-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")
+ local linuxrelease=$(find_linux_release)
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/*/${kib_rpm}-devel-${ofed_version}-${linuxrelease//-/_}.*.rpm)
[ -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,set-value:,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,noiokit,ofed-version:,publish,release,set-value:,src,stage:,tag:,target:,target-archs:,with-linux:,xen -- "$@")
if [ $? != 0 ]; then
usage 1