Whamcloud - gitweb
LU-303 fix ofed download for bugfix releases
[fs/lustre-release.git] / build / lbuild-rhel
index bcac604..5b80742 100644 (file)
@@ -108,6 +108,11 @@ prepare_and_build_srpm() {
         return 1
     fi
 
+    # for informative purposes, display a diff between the .config that
+    # was actually built and what we proposed as a .config
+    echo "Diffs between $(basename $CONFIG_FILE) and the built kernel's .config:"
+    diff -u $CONFIG_FILE $TOPDIR/BUILD/kernel-${lnxmaj}-${lnxrel}/linux-${lnxmaj}-${lnxrel}.${BUILD_ARCHS# }/.config
+
     return 0
 
 }
@@ -170,3 +175,26 @@ unpack_linux_devel_rpm-rhel() {
     return 0
 
 }
+
+# this of course requires a sudo rule on the builder for real RHEL:
+# hudson ALL= NOPASSWD: /usr/bin/yumdownloader
+# also must disable the requiretty attribute in the sudoers file
+find_linux_rpm-rhel() {
+    local prefix="$1"
+    local wanted_kernel="$2"
+    local pathtorpms=${3:-"${KERNELRPMSBASE}/${lnxmaj}/${DISTRO}/${TARGET_ARCH}"}
+
+    local tmpdir=$(mktemp -d $pathtorpms/yumXXXXXX)
+    local sudo=""
+    if [ "$(lsb_release -s -i)" = "RedHatEnterpriseServer" ]; then
+        sudo="sudo"
+    fi
+    $sudo yumdownloader --destdir "$tmpdir" kernel-devel-"$wanted_kernel" > /dev/null
+    local rpm=$(cd $tmpdir; echo *)
+    mv "$tmpdir/$rpm" "$pathtorpms"
+    rmdir $tmpdir
+    echo "$rpm"
+
+    return 0
+
+}