X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=build%2Flbuild-sles10;h=4c727776258c857f298e6fa439075478c4e645db;hb=818b881ea0dbcb0b0e7a022d2cef4e6e72f32d23;hp=fa02b4887394d4fb261db9cf562dbe90b21b64c2;hpb=c9087b3536f47abfd1eee3d9eb194e4d775a6e95;p=fs%2Flustre-release.git diff --git a/build/lbuild-sles10 b/build/lbuild-sles10 index fa02b48..4c72777 100644 --- a/build/lbuild-sles10 +++ b/build/lbuild-sles10 @@ -1,32 +1,39 @@ # vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4: -DEVEL_KERNEL_TYPE="source" +# increment this if you have made a change that should force a new kernel +# to build built +#BUILD_GEN=1 +#BUILD_GEN=2 # bz19952: remove -lustre tag from kernel RPM names +BUILD_GEN=3 # bz19975 enable the building of src.rpms by default -prepare_and_build_srpm() { +source ${0%/*}/lbuild-sles - 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_specs() { # 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}/" \ + #cp $TOPDIR/SOURCES/kernel-$spec.spec{,.orig} + sed -i -e "s/^Release:.*/&_${buildid}/" \ -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 + SOURCES/kernel-${spec}.spec || fatal 1 "Error while editing SOURCES/kernel-${spec}.spec" + + if $KERNEL_LUSTRE_NAMING; then + # these are all of the changes needed because we change the package names + # to kernel-lustre-*. these should all go away when we stop this insanity + sed -i -e 's/^\(Name:.*kernel-\)\(.*\)/\1lustre-\2/' \ + -e "/^Provides: *kernel = /a\ +Provides: kernel-$spec = %{version}-%{release} +" \ + -e 's/\(.*\)\([^#].*\)fookernel-source/\1\2kernel-lustre-source/g' \ + -e '/^%build/,/^%changelog/s/kernel-\({*\)source/kernel-\1lustre-source/g' \ + SOURCES/kernel-${spec}.spec || fatal 1 "Error while editing SOURCES/kernel-${spec}.spec" + fi # XXX - a building-on-Ubuntu hack if grep -q "Ubuntu" /etc/issue; then @@ -35,67 +42,21 @@ curl ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.17/2.6.17 -e 's/^\(BuildRequires: .*\)$/#NOU \1/g' \ -e 's/%(\(chmod .*\))$/%(bash -c "\1")/' \ -e 's/ -a 109//' \ - SPECS/kernel-${spec}.spec + SOURCES/kernel-${spec}.spec || fatal 1 "Error while editing SOURCES/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} +unpack_linux_devel_rpm-sles10() { + local callers_rpm="$1" - if $lustre; then - echo "kernel-lustre-$DEVEL_KERNEL_TYPE" - else - echo "kernel-$DEVEL_KERNEL_TYPE" - fi + # get the Module.symvers out of the kenrel-flavor RPM + local kernelrpm=${callers_rpm/-source-/-$RPMSMPTYPE-} -} + if ! rpm2cpio < "$kernelrpm" | cpio -id ./usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$TARGET_ARCH/$RPMSMPTYPE/Module.symvers > /dev/null 2>&1; then + return 255 + fi -rpm_BUILD_kernel_dirname() { - local rpmsmptype="$1" - local lnxmaj="$2" - local lnxmin="$3" - local arch="$4" + return 0 - echo kernel-lustre-${rpmsmptype}-${lnxmaj}${lnxmin}/linux-${lnxmaj} }