Whamcloud - gitweb
LU-73 lbuild and friends for RHEL6
[fs/lustre-release.git] / build / lbuild-rhel6
diff --git a/build/lbuild-rhel6 b/build/lbuild-rhel6
new file mode 100644 (file)
index 0000000..9ac2a48
--- /dev/null
@@ -0,0 +1,78 @@
+# vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
+
+# increment this if you have made a change that should force a new kernel
+# to be built for this release of this distribution (only -- if you want to
+# force a kernel build on all releases of this distribution, update the BUILD_GEN
+# variable in build/lbuild-rhel and if you want to force kernel bulid for all
+# distributions, update the BUILD_GEN variable in build/lbuild)
+#BUILD_GEN+=".0"
+BUILD_GEN+=".1"                # added --with firmware to rpmbuild for rhel6
+
+source ${0%/*}/lbuild-rhel
+
+SPEC_NAME="kernel.spec"
+DEVEL_PATH_ARCH_DELIMETER="."
+
+patch_spec() {
+    local buildid="$1"
+
+    # edit the SPEC with our changes
+    patch_spec_common "$buildid"
+    sed -i -e '/^# empty final patch file to facilitate testing of kernel patches/i\
+# adds Lustre patches\
+Patch99995: linux-%{version}-lustre.patch' \
+           -e '/^ApplyOptionalPatch linux-kernel-test.patch/i\
+\
+# lustre patch\
+ApplyOptionalPatch linux-%{version}-lustre.patch\
+' \
+          SPECS/$SPEC_NAME 2>&1 || \
+        fatal 1 "Error while editing SPECS/$SPEC_NAME"
+
+
+    return 0
+
+}
+
+unpack_linux_devel_rpm-rhel6() {
+    local callers_rpm="$1"
+
+    unpack_linux_devel_rpm-rhel "$callers_rpm"
+
+
+    return 0
+
+}
+
+get_rpmbuildopts() {
+
+    if $KERNEL_LUSTRE_NAMING; then
+        echo -e "--define \"variant -lustre\" \c"
+    fi
+    echo "--with firmware"
+
+    return 0
+
+}
+
+find_linux_rpm-rhel6() {
+    local prefix="$1"
+    local wanted_kernel="$2"
+    local pathtorpms=${3:-"${KERNELRPMSBASE}/${lnxmaj}/${DISTRO}/${TARGET_ARCH}"}
+
+    local tmpdir=$(mktemp -d $pathtorpms/yumXXXXXX)
+    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
+
+}
+
+kernel_srpm_location() {
+
+    echo "ftp://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/"
+
+}