From 86a7e6c2a4379aa991e36801fcea542e690c3bc8 Mon Sep 17 00:00:00 2001 From: brian Date: Wed, 2 Dec 2009 22:00:56 +0000 Subject: [PATCH] b=21426 i=wangyb i=yangsheng Allow the easy dropping in of patches to OFED. This is mainly meant as a mechanism to test patches from OFA prior to them committing them to their upstream. We should likely never actually release a version of Lustre and OFED built with any OFED patches. --- build/autoMakefile.am.toplevel | 2 +- build/lbuild | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/build/autoMakefile.am.toplevel b/build/autoMakefile.am.toplevel index 0549cb7..792a53b 100644 --- a/build/autoMakefile.am.toplevel +++ b/build/autoMakefile.am.toplevel @@ -105,7 +105,7 @@ EXTRA_DIST = @PACKAGE_TARNAME@.spec \ build/sles8-update_rcfile_setting.sh build/update_oldconfig \ build/autoconf/lustre-build-linux.m4 \ build/autoconf/lustre-build.m4 build/rdac_spec \ - build/mptlinux.spec.patch + build/mptlinux.spec.patch build/patches rpms-real: @PACKAGE_TARNAME@.spec dist Makefile rpmbuild -ta $(distdir).tar.gz diff --git a/build/lbuild b/build/lbuild index 70d2af1..e48eb11 100755 --- a/build/lbuild +++ b/build/lbuild @@ -1098,15 +1098,45 @@ build_kernel_ib() { # OFED_ISCSI="$OFED_ISCSI --with-iser-mod" #fi + # assume we are just rebuilding the SRPM + local BUILD_TYPE=${BUILD_TYPE:-"--rebuild"} + local SOURCE="${TOPDIR}/OFED/SRPMS/ofa_kernel-*.src.rpm" + + # but switch to building from the SPEC if we need to apply patches + if ls ${TOPDIR}/lustre/build/patches/ofed/* >/dev/null; then + BUILD_TYPE="-bb" + rpm --define "_topdir ${TOPDIR}" -ivh $SOURCE + SOURCE="${TOPDIR}/SPECS/ofa_kernel.spec" + local file ed_fragment1 ed_fragment2 n=1 + for file in ${TOPDIR}/lustre/build/patches/ofed/*; do + ed_fragment1="$ed_fragment1 +Patch$n: ${file%%*/}" + ed_fragment2="$ed_fragment2 +%patch$n -p0" + cp $file ${TOPDIR}/SOURCES + let n=$n+1 + done + + ed $SOURCE <