From c0e8a5cb51bf1a8c6854b2bda2f49b4b9dd9a4cb Mon Sep 17 00:00:00 2001 From: Dmitry Eremin Date: Wed, 27 Nov 2013 23:24:54 +0400 Subject: [PATCH] LU-4318 lbuild: build failed if kernel source in command line For OFED and ZFS builds the function $(find_linux_release) is used. But it defined in $LBUILD_DIR/lbuild-$DISTRO that is not included in case of build when kernel source tree was given on the command line. Signed-off-by: Dmitry Eremin Change-Id: I5f7ae64f560c76e745dc7314465c7fa7d9ec275f Reviewed-on: http://review.whamcloud.com/8421 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Minh Diep Reviewed-by: Bob Glossman Reviewed-by: Oleg Drokin --- contrib/lbuild/lbuild | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/lbuild/lbuild b/contrib/lbuild/lbuild index ffea52d..589c89c 100755 --- a/contrib/lbuild/lbuild +++ b/contrib/lbuild/lbuild @@ -273,6 +273,8 @@ check_options() { DISTRO=${DISTRO/-/} fi + [ -z "$TARGET" ] && TARGET=$(autodetect_target "$DISTRO") + if [ -z "$LINUX" ]; then [ "$KERNELDIR" -o "$KERNELTREE" ] || \ usage 1 "A kernel directory must be specified with --kerneldir or --kerneltree." @@ -280,7 +282,6 @@ check_options() { [ -d "$KERNELDIR" -o -d "$KERNELTREE" ] || \ usage 1 "$KERNELDIR and $KERNELTREE are not a directory." - [ "$TARGET" ] || TARGET=$(autodetect_target "$DISTRO") # TARGET_FILE="$TOPDIR/lustre/kernel_patches/targets/$TARGET.target" # [ -r "$TARGET_FILE" ] || \ # usage 1 "Target '$TARGET' was not found." @@ -2190,6 +2191,9 @@ create_rpmbuild_dirs # if an unpacked kernel source tree was given on the command line # just build lustre with it (nothing distro kernel specific here) if [ -n "$LINUX" ]; then + find_linux_release() { + _find_linux_release $LINUX + } build_ofed "${LINUXOBJ:-$LINUX}" "$OFED_VERSION" || fatal 1 "error building OFED" build_lustre "$LINUX" "$LINUXOBJ" -- 1.8.3.1