From 065c4a4f99c0bcf41c319a31fccdaaad94b9a548 Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Mon, 7 Mar 2011 17:37:44 -0500 Subject: [PATCH] LU-62 rhel6 support So that RHEL6 client can be built. Signed-off-by: Brian J. Murrell Change-Id: Ie5ff1249aee8725625901d1dad242a8f8c48765a Reviewed-on: http://review.whamcloud.com/385 Tested-by: Hudson Reviewed-by: Johann Lombardi --- build/funcs.sh | 1 + build/lbuild | 3 + build/lbuild-rhel6 | 71 +++++++++++++++++++++++ lustre/autoconf/lustre-core.m4 | 1 + lustre/kernel_patches/targets/2.6-rhel6.target.in | 24 ++++++++ 5 files changed, 100 insertions(+) create mode 100644 build/lbuild-rhel6 create mode 100644 lustre/kernel_patches/targets/2.6-rhel6.target.in diff --git a/build/funcs.sh b/build/funcs.sh index f7046f5..09292d0 100644 --- a/build/funcs.sh +++ b/build/funcs.sh @@ -179,6 +179,7 @@ autodetect_target() { case ${distro} in oel5) target="2.6-oel5";; rhel5) target="2.6-rhel5";; + rhel6) target="2.6-rhel6";; sles10) target="2.6-sles10";; sles11) target="2.6-sles11";; *) fatal 1 "I don't know what distro $distro is.\nEither update autodetect_target() or use the --target argument.";; diff --git a/build/lbuild b/build/lbuild index b761fc6..2b8e051 100755 --- a/build/lbuild +++ b/build/lbuild @@ -291,6 +291,9 @@ check_options() { fi case $TARGET in + 2.6-rhel6) + CANONICAL_TARGET="rhel6" + ;; 2.6-rhel5) CANONICAL_TARGET="rhel5" ;; diff --git a/build/lbuild-rhel6 b/build/lbuild-rhel6 new file mode 100644 index 0000000..53bcee7 --- /dev/null +++ b/build/lbuild-rhel6 @@ -0,0 +1,71 @@ +# 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}"} + + find_linux_rpm-rhel "$prefix" "$wanted_kernel" "$pathtorpms" + +} + +kernel_srpm_location() { + + echo "ftp://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/" + +} diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index fd971bc..9ae3659 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -2497,6 +2497,7 @@ lustre/include/lustre/Makefile lustre/kernel_patches/targets/2.6-suse.target lustre/kernel_patches/targets/2.6-vanilla.target lustre/kernel_patches/targets/2.6-rhel4.target +lustre/kernel_patches/targets/2.6-rhel6.target lustre/kernel_patches/targets/2.6-rhel5.target lustre/kernel_patches/targets/2.6-fc5.target lustre/kernel_patches/targets/2.6-patchless.target diff --git a/lustre/kernel_patches/targets/2.6-rhel6.target.in b/lustre/kernel_patches/targets/2.6-rhel6.target.in new file mode 100644 index 0000000..0c1d2b5 --- /dev/null +++ b/lustre/kernel_patches/targets/2.6-rhel6.target.in @@ -0,0 +1,24 @@ +lnxmaj="2.6.32" +lnxrel="71.18.2.el6" + +KERNEL_SRPM=kernel-${lnxmaj}-${lnxrel}.src.rpm +EXTRA_VERSION=${lnxrel}_lustre.@VERSION@ +LUSTRE_VERSION=@VERSION@ + +OFED_VERSION=inkernel + +BASE_ARCHS="i686 x86_64 ia64 ppc64" +BIGMEM_ARCHS="" +BOOT_ARCHS="" +JENSEN_ARCHS="" +#SMP_ARCHS="i686 x86_64 ia64 ppc64" +# RHEL5 doesn't use smp specific kernels +SMP_ARCHS="" +UP_ARCHS="" + +for cc in gcc ; do + if which $cc >/dev/null 2>/dev/null ; then + export CC=$cc + break + fi +done -- 1.8.3.1