From 016a14f3d371b73ee7e2e18a89463de4dcecd25f Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Wed, 24 Feb 2010 13:53:20 -0500 Subject: [PATCH] b=19336 post landing cleanups Remove generic find_linux_devel_paths() - now that both the rhel5 and sles method files have their own particular version of this method, remove this hacky-trying-to-work-for-both versions from lbuild. Remove a block of what is now redundant code. Remove the comments from the target files describing what happened with this bug. Align the sles10 and sles11 target files: - include the rpmfix specifier in the sles10 file - remove the EXTRA_VERSION_DELIMETER from the sles10 file - change the TARGET_DELIMETER to FLAVOR_DELIMETER in the sles11 file Some whitespace cleanups. i=wangyb i=yangsheng --- build/lbuild | 50 +--------------------- build/lbuild-sles11 | 33 +++++++------- lustre/kernel_patches/targets/2.6-rhel5.target.in | 2 +- lustre/kernel_patches/targets/2.6-sles10.target.in | 13 +++--- lustre/kernel_patches/targets/2.6-sles11.target.in | 2 +- 5 files changed, 23 insertions(+), 77 deletions(-) diff --git a/build/lbuild b/build/lbuild index d4c6170..04e972b 100755 --- a/build/lbuild +++ b/build/lbuild @@ -51,6 +51,7 @@ TIMESTAMP= # this is a dir to try reuse old kernel RPMs in (although, it seems to be # unused in any real manner REUSERPM= +# this is the dir that should be used to store reuse products REUSEBUILD= # should cached products be used or force rebuilding? USE_BUILD_CACHE=true @@ -1033,55 +1034,6 @@ unpack_linux_devel_rpm() { } -# XXX - this rhel/sles goop needs abstracting out into the -# lbuild-{rhel5,sles10} method files -find_linux_devel_paths() { - local path="$1" - - local RC=0 - - pushd $path - # RHEL-style and SLES-style rpms - # XXX - until bug 19336 cleans this up, we need to extricate the - # ${lnxmin}- from the $lnxrel - local paths="kernels/${lnxmaj}${lnxmin}${delimiter}${lnxrel}-${TARGET_ARCH} linux-${lnxmaj}${lnxmin}${delimiter}${lnxrel##${lnxmin#.}-}" - - local path - for path in $paths; do - local src='usr/src' - - if [ -d "$src/$path/" ]; then - LINUX="$(pwd)/$src/$path" - fi - # SLES has a separate -obj tree - if [ -d "$src/${path}-obj" ]; then - local src="$src/${path}-obj" - local objects="$TARGET_ARCH/$RPMSMPTYPE" - - # Novell, are you *TRYING* to make life hard for me? - if [ -d "$src/powerpc" ]; then - objects="powerpc/$TARGET_ARCH" - elif [ $TARGET_ARCH == 'i686' ]; then - objects="i386/$RPMSMPTYPE" - fi - - LINUXOBJ="$(pwd)/$src/$objects" - fi - done - if [ -z "$LINUX" ]; then - RC=255 - else - # dig out the release version - LINUXRELEASE=$(find_linux_release ${LINUXOBJ:-$LINUX}) - if [ -z "$LINUXRELEASE" ]; then - echo "Failed to find linux release in ${LINUXOBJ:-$LINUX}" - RC=255 - fi - fi - popd - return $RC -} - build_kernel_ib() { local linux="$1" diff --git a/build/lbuild-sles11 b/build/lbuild-sles11 index 6f00c5f..32f79b5 100644 --- a/build/lbuild-sles11 +++ b/build/lbuild-sles11 @@ -28,24 +28,24 @@ cp %_sourcedir/linux-2.6.27-lustre.patch %_builddir/%{name}-%{version}/lustre.p 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\ + sed -i -e 's/^\(Name:.*kernel-\)\(.*\)/\1lustre-\2/' \ + -e "/^Provides: *kernel = /a\ Provides: kernel-$spec = %{version}-%{release} " \ - -e 's/^\([ ][ ]*-i %_builddir\/kernel-\)\(source-2.6.27.21\/\$patch; then\)/\1lustre-\2/' \ - -e '/^%build/,/^%changelog/s/\(kernel-\)\(source\.files\)/\1lustre-\2/g' \ - -e '/--no-backup-if-mismatch/,/fi/s/kernel-source-/kernel-lustre-source-/g' \ - -e "s/^\(%package -n kernel-\)\(.*\)/\1lustre-\2/" \ - -e "s/^\(%description -n kernel-\)\(.*\)/\1lustre-\2/" \ - -e "s/^\(%files -n kernel-\)\(.*\)/\1lustre-\2/" \ - -e "s/^\(Provides:.*kernel-\)\(.*\)/\1lustre-\2/" \ - -e "s/^\(Requires:.*kernel-\)\(.*\)/\1lustre-\2/" \ - -e "s/^\(Supplements:.*kernel-\)\(.*\)/\1lustre-\2/" \ - SOURCES/kernel-${spec}.spec || \ - fatal 1 "Error while editing SOURCES/kernel-${spec}.spec" + -e 's/^\([ ][ ]*-i %_builddir\/kernel-\)\(source-2.6.27.21\/\$patch; then\)/\1lustre-\2/' \ + -e '/^%build/,/^%changelog/s/\(kernel-\)\(source\.files\)/\1lustre-\2/g' \ + -e '/--no-backup-if-mismatch/,/fi/s/kernel-source-/kernel-lustre-source-/g' \ + -e "s/^\(%package -n kernel-\)\(.*\)/\1lustre-\2/" \ + -e "s/^\(%description -n kernel-\)\(.*\)/\1lustre-\2/" \ + -e "s/^\(%files -n kernel-\)\(.*\)/\1lustre-\2/" \ + -e "s/^\(Provides:.*kernel-\)\(.*\)/\1lustre-\2/" \ + -e "s/^\(Requires:.*kernel-\)\(.*\)/\1lustre-\2/" \ + -e "s/^\(Supplements:.*kernel-\)\(.*\)/\1lustre-\2/" \ + SOURCES/kernel-${spec}.spec || \ + fatal 1 "Error while editing SOURCES/kernel-${spec}.spec" fi - # XXX - a building-on-Ubuntu hack + # 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' \ @@ -65,10 +65,7 @@ unpack_linux_devel_rpm-sles11() { local kernelrpm local wanted_kernel="${lnxmaj}${lnxmin}-${lnxrel}" - if $PATCHLESS; then -# this $PATCHLESS block should go away when bug 19336 lands. - wanted_kernel="${lnxmaj}${lnxmin}-${lnxrel}" - fi + # this is a hack that should go away when the modified lustre kernel # Provides kernel-default-base vvvvvvvvv if ! kernelrpm=$(find_rpm "$rpmdir" provides "^kernel-(lustre-)?default-base = $wanted_kernel"); then diff --git a/lustre/kernel_patches/targets/2.6-rhel5.target.in b/lustre/kernel_patches/targets/2.6-rhel5.target.in index f4d3de5..69c5edb 100644 --- a/lustre/kernel_patches/targets/2.6-rhel5.target.in +++ b/lustre/kernel_patches/targets/2.6-rhel5.target.in @@ -1,7 +1,7 @@ lnxmaj="2.6.18" lnxrel="164.11.1.el5" -KERNEL_SRPM=kernel-$lnxmaj-$lnxrel.src.rpm +KERNEL_SRPM=kernel-${lnxmaj}-${lnxrel}.src.rpm SERIES=2.6-rhel5.series EXTRA_VERSION=${lnxrel}_lustre.@VERSION@ LUSTRE_VERSION=@VERSION@ diff --git a/lustre/kernel_patches/targets/2.6-sles10.target.in b/lustre/kernel_patches/targets/2.6-sles10.target.in index a63d8e5..f1620bb 100644 --- a/lustre/kernel_patches/targets/2.6-sles10.target.in +++ b/lustre/kernel_patches/targets/2.6-sles10.target.in @@ -1,19 +1,16 @@ lnxmaj="2.6.16" lnxmin=".60" -# when we fix up this lnxmaj/lnxmin/lnxrel business... -#lnxrel="0.37_f594963d" -# and note that this means we get rid of the EXTRA_VERSION_DELIMITER crap!! lnxrel="0.42.8" - -# this is the delimeter that goes between $lnxmaj and $lnxrel -# defaults to "-" -EXTRA_VERSION_DELIMITER="." +# use this when there is an "RPM fix" which means that the name of the +# (source) RPM has been updated but the version of the kernel inside the +# RPM is not also updated +rpmfix="" # this is the delimeter that goes before the "smp" at the end of the version # defaults to empty FLAVOR_DELIMITER="-" -KERNEL_SRPM=kernel-source-${lnxmaj}${lnxmin}-${lnxrel}.src.rpm +KERNEL_SRPM=kernel-source-${lnxmaj}${lnxmin}-${lnxrel}${rpmfix}.src.rpm SERIES=2.6-sles10.series VERSION=$lnxmaj EXTRA_VERSION="${lnxmin#.}-${lnxrel}_lustre.@VERSION@" diff --git a/lustre/kernel_patches/targets/2.6-sles11.target.in b/lustre/kernel_patches/targets/2.6-sles11.target.in index 30638f5..a0c371e 100644 --- a/lustre/kernel_patches/targets/2.6-sles11.target.in +++ b/lustre/kernel_patches/targets/2.6-sles11.target.in @@ -8,7 +8,7 @@ rpmfix=".1" # this is the delimeter that goes before the "smp" at the end of the version # defaults to empty -TARGET_DELIMITER="-" +FLAVOR_DELIMITER="-" KERNEL_SRPM=kernel-source-${lnxmaj}${lnxmin}-${lnxrel}${rpmfix}.src.rpm SERIES=2.6-sles11.series -- 1.8.3.1