Whamcloud - gitweb
No RPM is built when NO_SRC=0, but we should have the rpms being built.
[fs/lustre-release.git] / build / lbuild
index 48dfd97..598cb68 100755 (executable)
@@ -570,7 +570,8 @@ build_lustre()
     ./configure "--with-linux=${LINUX}" ${CONFIGURE_FLAGS}
 
     $RPMBUILD $targets -bb build/lustre.spec \
-        --define "_topdir $TOPDIR" || \
+        --define "_topdir $TOPDIR" \
+        --define "configure_flags --with-linux=${LINUX}" || \
         fatal 1 "Error building rpms for $BUILD_ARCHS."
 
     popd >/dev/null
@@ -703,17 +704,31 @@ if [ -z "$LINUX" ] ; then
             patch_linux
             pack_linux
             clean_linux
+        fi
 
-            prep_kernel_build
-            clean_lustre
+        prep_kernel_build
+        clean_lustre
 
-            build_kernel
-        fi
+        build_kernel
     else
         # can't build a kernel if we have no series for it (i.e. patchless)
         # but we still need the headers
         unpack_linux
         LINUX=$(pwd)/linux
+        pushd $LINUX && {
+            # need a .config -- like a user would do
+            BOOTCONFIG="/boot/config-${lnxmaj}-${lnxrel}smp"
+            if [ -f $BOOTCONFIG ]; then
+                cp $BOOTCONFIG .config
+            else
+                fatal 1 "$BOOTCONFIG doesn't exist!  Help!"                
+            fi
+            make oldconfig
+            make include/asm
+            make include/linux/version.h
+            make SUBDIRS=scripts
+        }
+        popd
         build_lustre
     fi
 else