Whamcloud - gitweb
LU-4318 lbuild: build failed if kernel source in command line 21/8421/3
authorDmitry Eremin <dmitry.eremin@intel.com>
Wed, 27 Nov 2013 19:24:54 +0000 (23:24 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 6 Jan 2014 15:41:15 +0000 (15:41 +0000)
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 <dmitry.eremin@intel.com>
Change-Id: I5f7ae64f560c76e745dc7314465c7fa7d9ec275f
Reviewed-on: http://review.whamcloud.com/8421
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
contrib/lbuild/lbuild

index ffea52d..589c89c 100755 (executable)
@@ -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"