Whamcloud - gitweb
LU-11019 build: Update ZFS/SPL to 0.7.9
[fs/lustre-release.git] / contrib / lbuild / lbuild
index 82cb06f..db3795f 100755 (executable)
@@ -951,10 +951,8 @@ build_lustre() {
     return 0
 }
 
-# Only zfs Lustre DKMS Server is supported
 build_lustre_dkms() {
     local build_args=""
-    local name_prefix="lustre"
     local ver=$(sed -n -e 's/^LUSTRE_VERSION = //p' LUSTRE-VERSION-FILE)
 
     echo "Building Lustre DKMS RPMs for: $TARGET_ARCH"
@@ -962,14 +960,36 @@ build_lustre_dkms() {
 
     if $PATCHLESS; then
         build_args="--without servers"
-        name_prefix="lustre-client"
     fi
 
     rpmbuild --define "_topdir $TOPDIR" $build_args -bs lustre-dkms.spec ||
         fatal 1 "Error building DKMS .src.rpm for $TARGET_ARCH."
-    rpmbuild --define "_topdir $TOPDIR" $build_args \
-             --rebuild $TOPDIR/SRPMS/$name_prefix-dkms-$ver-*.src.rpm ||
+
+    if $PATCHLESS; then
+       rpmbuild --define "_topdir $TOPDIR" $build_args \
+             --rebuild $TOPDIR/SRPMS/lustre-client-dkms-$ver-*.src.rpm ||
         fatal 1 "Error building DKMS .rpm for $TARGET_ARCH."
+    else
+       rpmbuild --define="_topdir $TOPDIR" --with servers \
+           --with zfs --without ldiskfs -bs lustre-dkms.spec ||
+       fatal 1 "Error creating DKMS (zfs) .srpm for $TARGET_ARCH."
+       rpmbuild --define="_topdir $TOPDIR" --with servers \
+           --without zfs --with ldiskfs -bs lustre-dkms.spec ||
+       fatal 1 "Error creating DKMS (ldiskfs) .srpm for $TARGET_ARCH."
+       rpmbuild --define="_topdir $TOPDIR" --with servers \
+           --with zfs --with ldiskfs -bs lustre-dkms.spec ||
+       fatal 1 "Error creating DKMS (all) .srpm for $TARGET_ARCH."
+
+       rpmbuild --rebuild --define="_topdir $TOPDIR" --with servers \
+           --with zfs --without ldiskfs $TOPDIR/SRPMS/lustre-zfs-dkms-$ver-*.src.rpm ||
+       fatal 1 "Error building DKMS (zfs) .rpm for $TARGET_ARCH."
+       rpmbuild --rebuild --define="_topdir $TOPDIR" --with servers \
+           --without zfs --with ldiskfs $TOPDIR/SRPMS/lustre-ldiskfs-dkms-$ver-*.src.rpm ||
+       fatal 1 "Error building DKMS (ldiskfs) .rpm for $TARGET_ARCH."
+       rpmbuild --rebuild --define="_topdir $TOPDIR" --with servers \
+           --with zfs --with ldiskfs $TOPDIR/SRPMS/lustre-all-dkms-$ver-*.src.rpm ||
+       fatal 1 "Error building DKMS (all) .rpm for $TARGET_ARCH."
+    fi
 
     return 0
 }
@@ -994,7 +1014,7 @@ build_spl_zfs() {
     # The spl/zfs spec files expect RPM_BUILD_ROOT to point to the root of the
     # destination for the rpms
     export RPM_BUILD_ROOT=$TOPDIR
-    SPLZFSVER=${SPLZFSVER:-0.7.1}
+    SPLZFSVER=${SPLZFSVER:-0.7.9}
     SPLZFSTAG=${SPLZFSTAG:-}
 
     # The files expect a kver to be set to the kernel version .
@@ -1342,13 +1362,9 @@ store_for_reuse() {
         linkflag="l"
     fi
 
-    local default_iface=$(/sbin/ip route get 192.1.1.1 | sed -ne 's/.* dev \(.*\)  * src .*/\1/p')
-    if [ -z "$default_iface" ]; then
-        fatal 1 "Failed to determine the default route interface"
-    fi
-    local unique_id=$(/sbin/ip addr show dev $default_iface | sed -ne '/ inet /s/ *inet \(.*\)\/.*/\1/p' | head -1)
+    local unique_id=$(hostname -s)
     if [ -z "$unique_id" ]; then
-        fatal 1 "Failed to determine a unique id from interface $default_interface"
+        fatal 1 "Failed to determine hostname."
     fi
 
     local finallocation="$location"/"$signature"/"$module"