[Bug 271286] New: issues with CODE10 kernel module package build
https://bugzilla.novell.com/show_bug.cgi?id=271286 Summary: issues with CODE10 kernel module package build Product: openSUSE 10.2 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Kernel AssignedTo: kernel-maintainers@forge.provo.novell.com ReportedBy: hpj@urpla.net QAContact: qa@suse.de CC: agruen@novell.com Hi Andreas et.al., I'm facing an ugly issue with building CODE10 kernel module packages, while multiple kernel versions are installed. On all my (production) systems, I update kernels in installonly mode (within a handrolled yum infrastructure, btw) to be able to switch back quickly. Building some necessary kernel modules for the current update to 2.6.18.8-0.3 revealed a problem again, which I workarounded in former times by uninstalling the older kernels, but this time I bite the apple. The problem results in kernel packages names like: nvidia-kmp-bigsmp-1.0.9755_2.6.18.8_0.12.6.18.8_0.3-1.i586.rpm See: the versions 2.6.18.8_0.1 and 2.6.18.8_0.3 are concatenated. I managed to work around the issue by defining a hopefully matching kver symbol, and replaced the default subpkg template with one, that doesn't fiddle with expansion of %{-r*} in the Version tag. I hopefully don't need to express the ugliness of this move ;-) I've attached such an offending spec, but refrained to upload the full source rpm, since it is 25MB. This is my first CODE10 kernel module package, and I would like to have this issue fixed before starting to convert other packages. -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=271286 ------- Comment #1 from hpj@urpla.net 2007-05-04 05:57 MST ------- Created an attachment (id=137536) --> (https://bugzilla.novell.com/attachment.cgi?id=137536&action=view) nvidia kmp package Yes, I do build my nvidia kmp myself, since the official sites are way behind, and I hate/refrain from installing them manually. -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=271286 gregkh@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|kernel- |agruen@novell.com |maintainers@forge.provo.nove| |ll.com | -- 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, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=271286 User agruen@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=271286#c2 Andreas Gruenbacher <agruen@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --- Comment #2 from Andreas Gruenbacher <agruen@novell.com> 2008-03-03 17:05:56 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. 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.) 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) -- 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.
https://bugzilla.novell.com/show_bug.cgi?id=271286 User hpj@urpla.net added comment https://bugzilla.novell.com/show_bug.cgi?id=271286#c3 Hans-Peter Jansen <hpj@urpla.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #137536|0 |1 is obsolete| | --- Comment #3 from Hans-Peter Jansen <hpj@urpla.net> 2008-03-03 17:22:36 MST --- Created an attachment (id=198374) --> (https://bugzilla.novell.com/attachment.cgi?id=198374) updated nvidia spec file -- 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.
https://bugzilla.novell.com/show_bug.cgi?id=271286 User hpj@urpla.net added comment https://bugzilla.novell.com/show_bug.cgi?id=271286#c4 --- Comment #4 from Hans-Peter Jansen <hpj@urpla.net> 2008-03-03 17:29:16 MST --- Created an attachment (id=198376) --> (https://bugzilla.novell.com/attachment.cgi?id=198376) the fixed kernel-module-subpackage rpm macro Using this macro, I get the expected result of %name-%version-%kernelversion_%kernelrelease-%release Also note, that I changed the package requirements to include the %kernelversion_%kernelrelease. That way, I get packages, that can be installed/removed for every installed kernel. -- 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.
https://bugzilla.novell.com/show_bug.cgi?id=271286 User hpj@urpla.net added comment https://bugzilla.novell.com/show_bug.cgi?id=271286#c5 --- Comment #5 from Hans-Peter Jansen <hpj@urpla.net> 2008-03-03 17:33:50 MST --- Created an attachment (id=198377) --> (https://bugzilla.novell.com/attachment.cgi?id=198377) spec to build the x11 driver portion -- 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.
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.
participants (1)
-
bugzilla_noreply@novell.com