From 2525f4a7a2664416a1f4e2e9b9324db0bcb69c09 Mon Sep 17 00:00:00 2001 From: yangsheng Date: Thu, 21 May 2009 07:22:16 +0000 Subject: [PATCH] Branch b1_8 b=18668 i=johann, brian SLES11 patchless support. --- build/autoconf/lustre-build-linux.m4 | 2 +- build/lbuild | 4 ++ build/lbuild-sles11 | 108 +++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 build/lbuild-sles11 diff --git a/build/autoconf/lustre-build-linux.m4 b/build/autoconf/lustre-build-linux.m4 index c32cc4d..d0cdb76 100644 --- a/build/autoconf/lustre-build-linux.m4 +++ b/build/autoconf/lustre-build-linux.m4 @@ -368,7 +368,7 @@ AC_DEFUN([LB_LINUX_ARCH], [AC_MSG_CHECKING([Linux kernel architecture]) AS_IF([rm -f $PWD/build/arch make -s --no-print-directory echoarch -f $PWD/build/Makefile \ - LUSTRE_LINUX_CONFIG=$LINUX_CONFIG -C $LINUX_OBJ $ARCH_UM \ + LUSTRE_LINUX_CONFIG=$LINUX_CONFIG -C $LINUX $ARCH_UM \ ARCHFILE=$PWD/build/arch && LINUX_ARCH=`cat $PWD/build/arch`], [AC_MSG_RESULT([$LINUX_ARCH])], [AC_MSG_ERROR([Could not determine the kernel architecture.])]) diff --git a/build/lbuild b/build/lbuild index 88e650c..18665ad 100755 --- a/build/lbuild +++ b/build/lbuild @@ -780,6 +780,10 @@ set_rpm_smp_type() { [ $infact_arch == $smp_type ] && RPMSMPTYPE=bigsmp && break done + for smp_type in $DEFAULT_ARCHS; do + [ $infact_arch == $smp_type ] && RPMSMPTYPE=default && break + done + } # This function takes a linux source pool and digs out the linux release diff --git a/build/lbuild-sles11 b/build/lbuild-sles11 new file mode 100644 index 0000000..ca1ca796 --- /dev/null +++ b/build/lbuild-sles11 @@ -0,0 +1,108 @@ +# vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4: + +# increment this if you have made a change that should force a new kernel +# to build built +BUILD_GEN=1 + +DEVEL_KERNEL_TYPE="source" + +prepare_and_build_srpm() { + + pushd $TOPDIR >/dev/null + # seems there is a bug (on Ubuntu at least) where all of the .specs + # are not put into SPECS + mv SOURCES/*.spec SPECS/ + + # generate our buildid + local buildid="lustre${EXTRA_VERSION##*_lustre}" + + # edit the SPECs with our changes + local spec + for spec in $RPMSMPTYPE source; do + #cp $TOPDIR/SPECS/kernel-$spec.spec{,.orig} + sed -i -e 's/^\(Name:.*kernel-\)\(.*\)/\1lustre-\2/' \ + -e "s/^Release:.*/&_${buildid}/" \ + -e "/^Provides: *kernel = /a\ +Provides: kernel-$spec = %{version}-%{release} +" \ + -e "s/^ExclusiveArch:.*/& ppc ppc64/" \ + -e '/^# Apply the patches needed for this architecture\./a\ +cp %_sourcedir/linux-2.6.16-lustre.patch %_builddir/%{name}-%{version}/lustre.patch\ +! grep -q lustre.patch %_sourcedir/series.conf && echo -e "\\n\\tlustre.patch" >> %_sourcedir/series.conf' \ + -e "/flavor=\${config/a\ + [ \"\$flavor\" == \"$RPMSMPTYPE\" ] || continue" \ + -e 's/\(.*\)\([^#].*\)fookernel-source/\1\2kernel-lustre-source/g' \ + -e '/^%build/,/^%changelog/s/kernel-\({*\)source/kernel-\1lustre-source/g' \ + SPECS/kernel-${spec}.spec + + # XXX - a building-on-Ubuntu hack + if grep -q "Ubuntu" /etc/issue; then + sed -i -e '/^%_sourcedir\/install-configs %_sourcedir .*/i\ +curl ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.17/2.6.17-mm1/broken-out/i386-use-c-code-for-current_thread_info.patch | patch -p1' \ + -e 's/^\(BuildRequires: .*\)$/#NOU \1/g' \ + -e 's/%(\(chmod .*\))$/%(bash -c "\1")/' \ + -e 's/ -a 109//' \ + SPECS/kernel-${spec}.spec + fi +done + + # XXX - need to flesh this out per the rhel5 method + local targets + for arch in $BUILD_ARCHS; do + targets="--target $arch $targets" + mkdir -p config/$(basearch $arch) + cp $CONFIG_FILE config/$(basearch $arch)/$RPMSMPTYPE + done + + tar cjf SOURCES/config.tar.bz2 config + rm -rf config + + # do we need any special rpm build options + local rpmbuildopt="-bb" + if $DO_SRC; then + rpmbuildopt="-ba" + fi + + # XXX - ignore the kabi changes. need to figure out what this is really + # all about. + touch SOURCES/IGNORE-KABI-BADNESS + + +# XXX temp speedup hack +#if false; then + # now build it + if ! $RPMBUILD $rpmbuildopt $targets \ + --define "_topdir $TOPDIR" \ + $TOPDIR/SPECS/kernel-$RPMSMPTYPE.spec >&2; then + fatal 1 "Failed to build kernel RPM" + fi +#fi + + # for SLES10, we also need to build the kernel-source rpm + if ! $RPMBUILD $rpmbuildopt $targets \ + --define "_topdir $TOPDIR" \ + $TOPDIR/SPECS/kernel-source.spec >&2; then + fatal 1 "Failed to build kernel source RPM" + fi + +} + +devel_kernel_name() { + local lustre=${1:-false} + + if $lustre; then + echo "kernel-lustre-$DEVEL_KERNEL_TYPE" + else + echo "kernel-$DEVEL_KERNEL_TYPE" + fi + +} + +rpm_BUILD_kernel_dirname() { + local rpmsmptype="$1" + local lnxmaj="$2" + local lnxmin="$3" + local arch="$4" + + echo kernel-lustre-${rpmsmptype}-${lnxmaj}${lnxmin}/linux-${lnxmaj} +} -- 1.8.3.1