Whamcloud - gitweb
Be more specific so that other lustre* cruft is not picked up.
[fs/lustre-release.git] / build / lbuild
index 48dfd97..09266e2 100755 (executable)
@@ -215,7 +215,8 @@ check_options()
             | suse-2.4.21-2 \
             | rh-2.4 \
             | rhel-2.4 \
-            | sles-2.4)
+            | sles-2.4 \
+            | 2.6-patchless)
                 CANONICAL_TARGET="$TARGET"
                 ;;
     esac
@@ -340,9 +341,13 @@ load_target()
     if [ "$EXTRA_VERSION_save" ] ; then
         EXTRA_VERSION="$EXTRA_VERSION_save"
     elif ! (( $RELEASE )) ; then
-        #remove the @VERSION@ (lustre version)
-        EXTRA_VERSION=$(echo $EXTRA_VERSION | sed -e "s/\(.*_lustre\)\..*/\1/")
-        EXTRA_VERSION="${EXTRA_VERSION}-${TAG}.${TIMESTAMP}"
+        # if there is no patch series, then this is not a lustre specific
+        # kernel.  don't make it look like one
+        if [ -n "$SERIES" ]; then
+            #remove the @VERSION@ (lustre version)
+            EXTRA_VERSION=$(echo $EXTRA_VERSION | sed -e "s/\(.*_lustre\)\..*/\1/")
+            EXTRA_VERSION="${EXTRA_VERSION}-${TAG}.${TIMESTAMP}"
+        fi
     fi
     # EXTRA_VERSION=${EXTRA_VERSION//-/_}
 
@@ -390,7 +395,7 @@ unpack_lustre()
     DIRNAME="lustre-$TAG-$TIMESTAMP"
     if [ "$LUSTRE" ] ; then
         untar "$LUSTRE"
-        [ -d lustre ] || ln -sf lustre* lustre
+        [ -d lustre ] || ln -sf lustre-[0-9].[0-9]* lustre
     else
         if [ "$USE_DATESTAMP" ]; then
             DATESTAMP="-D '$DATE'"
@@ -696,26 +701,17 @@ unpack_lustre
 # prep_build needs the .spec.in from the lustre source
 if [ -z "$LINUX" ] ; then
     load_target
-
-    if [ "$SERIES" ] ; then
-        if (( $DO_SRC )) ; then
-            unpack_linux
-            patch_linux
-            pack_linux
-            clean_linux
-
-            prep_kernel_build
-            clean_lustre
-
-            build_kernel
-        fi
-    else
-        # can't build a kernel if we have no series for it (i.e. patchless)
-        # but we still need the headers
+    if (( $DO_SRC )) ; then
         unpack_linux
-        LINUX=$(pwd)/linux
-        build_lustre
+        patch_linux
+        pack_linux
+        clean_linux
     fi
+
+    prep_kernel_build
+    clean_lustre
+
+    build_kernel
 else
     build_lustre
 fi