From e70f0336d475acc95dc3d86ce59ac59655b34f3a Mon Sep 17 00:00:00 2001 From: jacob Date: Fri, 13 May 2005 19:42:47 +0000 Subject: [PATCH] b=5854 fix /lib/modules/$(uname -r)/{build,source} to point to the correct locations for 2.6 kernels use --package arg to new-kernel-pkg if available --- build/lmake | 21 +++++++++++++++++++++ build/lustre-kernel-2.4.spec.in | 8 +++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/build/lmake b/build/lmake index a98478b..36c64e9 100755 --- a/build/lmake +++ b/build/lmake @@ -481,6 +481,25 @@ install_kernel() popd >/dev/null } +cleanup_libmodules() +{ + (( $INSTALL_LUSTRE )) || return 0 + + FULL_VERSION="${VERSION}-${EXTRA_VERSION}${TARGET_CONFIG}" + KVERREL="${VERSION}-${EXTRA_VERSION}" + i="$DESTDIR/lib/modules/${FULL_VERSION}" + + rm -f $i/build + rm -f $i/source + + if (( $LINUX26 )) ; then + ln -sf ../../../usr/src/linux-${KVERREL}-obj/${TARGET_ARCH}/${TARGET_CONFIG} $i/build + ln -sf ../../../usr/src/linux-${KVERREL} $i/source + else + ln -sf ../../../usr/src/linux-${KVERREL} $i/build + fi +} + install_lustre() { (( $INSTALL_LUSTRE )) || return 0 @@ -709,6 +728,8 @@ install_lustre install_kms +cleanup_libmodules + save_headers exit 0 diff --git a/build/lustre-kernel-2.4.spec.in b/build/lustre-kernel-2.4.spec.in index fbb0831..5066ea6 100644 --- a/build/lustre-kernel-2.4.spec.in +++ b/build/lustre-kernel-2.4.spec.in @@ -435,7 +435,11 @@ EOF [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth if [ -x /sbin/new-kernel-pkg ] ; then - /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}${flavor} + if /sbin/new-kernel-pkg 2>&1 | grep package >/dev/null ; then + PACKAGE_ARG="--package kernel-${flavor}" + fi + /sbin/new-kernel-pkg $PACKAGE_ARG --mkinitrd --depmod \ + --install %{KVERREL}${flavor} fi EOF ;; @@ -608,8 +612,6 @@ pushd lustre >/dev/null # specific for i in $RPM_BUILD_ROOT/lib/modules/* ; do rm -f $i/modules.* - rm -f $i/build - ln -sf ../../../usr/src/linux-%{KVERREL} $i/build %ifarch %{ntplarchs} # remove legacy pcmcia symlink that's no longer useful rm -rf $i/pcmcia -- 1.8.3.1