https://bugzilla.novell.com/show_bug.cgi?id=271286 User hpj@urpla.net added comment https://bugzilla.novell.com/show_bug.cgi?id=271286#c6 --- Comment #6 from Hans-Peter Jansen <hpj@urpla.net> 2008-03-04 04:49:24 MST ---
We don't have this issue in our build system(s) because the chroots that KMPs are built in have only one kernel-source package installed.
Sure, and I know, it's better in many ways to rpmbuild in chrooted environments. Nevertheless, the KMP infrastructure should also work with bog standard rpmbuild users (even they have more then one kernel installed), shouldn't it?
When there is more than one kernel version installed, it's not obvious anymore which kernel > to build for. (The current running kernel may be a good heuristic, but even that won't always be the desired result.)
For that reason, my specs optionally evaluate a kver argument.
It's not immediately obvious to me where the versions get concatenated, but this line in %suse_kernel_module_package() in /usr/lib/rpm/macros probably has to do with it:
kver=$(rpm -q --qf '%{VERSION}-%{RELEASE}' kernel-source)
Ahh, I see: ~> rpm -q --qf '%{VERSION}-%{RELEASE}' kernel-source 2.6.18.8-0.52.6.18.8-0.72.6.24.1-35.12.6.24.1-76.42.6.24.3-12.6.24.3-22.6.24.3-3 ~> rpm -q --qf '%{VERSION}-%{RELEASE}\n' kernel-source 2.6.18.8-0.5 2.6.18.8-0.7 2.6.24.1-35.1 2.6.24.1-76.4 2.6.24.3-1 2.6.24.3-2 2.6.24.3-3 Oh well... The best way would be to either let the spec define a kver explicitly, or use the current running kernel version. Here's the diff, that fixed the problem for me: --- SOURCES/kernel-module-subpackage 2006-12-08 15:28:03.000000000 +0100 +++ SOURCES/my-kernel-module-subpackage 2008-02-29 16:52:19.818762437 +0100 @@ -1,5 +1,5 @@ %package -n %{-n*}-%1 -Version: %(echo %{-v*}-%3 | tr - _) +Version: %(echo %{-v*} | tr - _) Release: %{-r*} %( for spec in {%_sourcedir,%_specdir}/%name.spec /dev/null; do @@ -19,8 +19,8 @@ END { print tags["summary"] print tags["group"] } ' $spec ) -Provides: %{-n*} = %(echo %{-v*}-%3 | tr - _) -Requires: kernel-%1 +Provides: %{-n*} = %(echo %{-v*} | tr - _) +Requires: kernel-%1 = %(echo %2 | sed -e 's/\(.*\)-.*$/\1/') AutoReqProv: on %{-p:%{expand:%(cd %_sourcedir; cat %{-p*})}} %description -n %{-n*}-%1 @@ -46,7 +46,7 @@ END { exit(! good) } ' $spec ) %post -n %{-n*}-%1 -version=%(echo %{-v*}-%3 | tr - _) +version=%(echo %{-v*} | tr - _) if [ -e /boot/System.map-%2 ]; then /sbin/depmod -a -F /boot/System.map-%2 %2 fi @@ -78,12 +78,12 @@ if [ -e /etc/sysconfig/kernel -a -e /boo fi fi %preun -n %{-n*}-%1 -version=%(echo %{-v*}-%3 | tr - _) +version=%(echo %{-v*} | tr - _) set -o noclobber rpm -ql %{-n*}-%1-$version-%{-r*} | grep '\.ko$' \ > /var/run/rpm-%{-n*}-%1-$version-%{-r*}-modules %postun -n %{-n*}-%1 -version=%(echo %{-v*}-%3 | tr - _) +version=%(echo %{-v*} | tr - _) modules=( $(cat /var/run/rpm-%{-n*}-%1-$version-%{-r*}-modules) ) rm -f /var/run/rpm-%{-n*}-%1-$version-%{-r*}-modules if [ -e /boot/System.map-%2 ]; then -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.