Skip to content
Snippets Groups Projects
Commit 2ba6fcc3 authored by Brian J. Murrell's avatar Brian J. Murrell
Browse files

b=16133

i=cliffw
i=wangyb

lbuild should not ignore the --with-linux option (and instead look for a
kernel-source RPM) specified for patchless builds
parent 23b433cd
No related branches found
No related tags found
No related merge requests found
......@@ -1023,6 +1023,20 @@ set_rpm_smp_type()
done
}
# This function takes a linux source pool and digs out the linux release
# from it
find_linux_release() {
local SRCDIR="$1"
local LINUXRELEASEHEADER=$SRCDIR/include/linux/version.h
if [ -s $SRCDIR/include/linux/utsrelease.h ]; then
LINUXRELEASEHEADER=$SRCDIR/include/linux/utsrelease.h
fi
sed -ne 's/#define UTS_RELEASE "\(.*\)"$/\1/p' $LINUXRELEASEHEADER
}
#unpack kernel(/source/devel) RPM
unpack_linux_rpm()
{
......@@ -1080,13 +1094,9 @@ unpack_linux_rpm()
RC=255
else
# dig out the release version
local LINUXRELEASEHEADER=version.h
if test -s ${LINUXOBJ:-$LINUX}/include/linux/utsrelease.h ; then
LINUXRELEASEHEADER=utsrelease.h
fi
LINUXRELEASE=$(sed -ne 's/#define UTS_RELEASE "\(.*\)"$/\1/p' ${LINUXOBJ:-$LINUX}/include/linux/$LINUXRELEASEHEADER)
LINUXRELEASE=$(find_linux_release ${LINUXOBJ:-$LINUX})
if [ -z "$LINUXRELEASE" ]; then
echo "Failed to find linux release in ${LINUXOBJ:-$LINUX}/include/linux/$LINUXRELEASEHEADER"
echo "Failed to find linux release in ${LINUXOBJ:-$LINUX}"
RC=255
fi
fi
......@@ -1305,6 +1315,22 @@ build_kernel_ib()
#build patchless lustre
patchless_build_sequence()
{
if [ -f $LINUX/Makefile ]; then
# Get the correct kernel release - I'm unsure how this can ever
# work otherwise, unless you're using the exact same kernel version
# Lustre is shipped with.
local LINUXRELEASE=$(find_linux_release ${LINUXOBJ:-$LINUX})
if [ -z "$LINUXRELEASE" ]; then
echo "Failed to find linux release in ${LINUXOBJ:-$LINUX}"
RC=255
fi
lnxmaj=$(echo $LINUXRELEASE | cut -f1 -d-)
EXTRA_VERSION=$(echo $LINUXRELEASE | cut -f2 -d-)_lustre.$LUSTRE_VERSION
RPMSMPTYPE=" "
build_lustre && buildsuccess=true
else
#try to build from kernel-devel RPM (RHEL)
LINUX=
TARGET_ARCH=
......@@ -1337,6 +1363,7 @@ patchless_build_sequence()
$rpmfound && build_kernel_ib
fi
( $rpmfound ) && build_lustre && buildsuccess=true && find_linux_source_rpm
fi
if $buildsuccess; then
[ -d "RPMS/${TARGET_ARCH}" ] && [ -f "$KERNELRPM" ] && \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment