FS#7150 - Adding kernel version as dep to module related packages (fglrx , madwifi etc)

Attached to Project: Arch Linux
Opened by Lone_Wolf (Lone_Wolf) - Sunday, 13 May 2007, 13:17 GMT
Last edited by Tobias Powalowski (tpowa) - Saturday, 26 January 2008, 16:04 GMT
Task Type Feature Request
Category System
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture All
Severity Medium
Priority Normal
Reported Version 0.8 Voodoo
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Due to problems with kernel 2.6.21 , i have to use kernel 2.6.20 on my laptop. (see flyspray 7124).

This also means i can't upgrade packages that are built against the newest kernel, like fglrx and madwifi.
(nvidia will probably have he same issue)

I propose to include the specific kernel version packages are built against in the pkgbuild.

This task depends upon

Closed by  Tobias Powalowski (tpowa)
Saturday, 26 January 2008, 16:04 GMT
Reason for closing:  Implemented
Comment by Roman Kyrylych (Romashka) - Sunday, 13 May 2007, 16:23 GMT
maybe you could just add those packages to IgnorePkg?
Comment by Lone_Wolf (Lone_Wolf) - Monday, 14 May 2007, 06:11 GMT
That's what i do now, but that approach has 2 problems :
- You have to figure out yourself which packages are kernel related
- when there's a new version of those packages, you have to check manually (cvs changelog) for what kernel they are build.
If you -Syu daily, you'll have the latest package for your kernel, but if you only -Syu weekly or monthly it is more tricky.

As those packages already have kernel26 as dep and need to be rebuild anayway for a new kernel, all this takes is adding the kernel version in the pkgbuild.
Comment by dtw (dibblethewrecker) - Thursday, 19 July 2007, 15:00 GMT
I think this is a reasonable request.

Is it permissable to do depends=(kernel26>=$_KERNEL_VER) - that'd make it nice and easy for devs to keep track of.
Comment by Lone_Wolf (Lone_Wolf) - Thursday, 19 July 2007, 18:13 GMT
I assume $_KERNEL_VER will be substituted by the version of the running kernel during makepkg ?

If that's how it works, it looks like a good solution.
Comment by Tobias Powalowski (tpowa) - Friday, 20 July 2007, 05:18 GMT
you don't solve the upgrade problem with it, >= is everything.
If the kernel bumps from .22 to .23 it still reports the module working.
Comment by dtw (dibblethewrecker) - Friday, 20 July 2007, 10:22 GMT
I don't understand. Consider an example:

http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/network/madwifi/PKGBUILD?rev=1.17&cvsroot=Extra&only_with_tag=CURRENT&content-type=text/vnd.viewcvs-markup

madwifi - uses _kernver to point to correct modules

If the depends line was changed to depends>=$_kernver, then surely people who do not update to new kernel will not be able to update to new madwifi pkg (once it was rebuilt).

Or am I missing something? Surely every module pkg depends on a specific kernel version purely because of the install location of the module itself?
Comment by Tobias Powalowski (tpowa) - Friday, 20 July 2007, 18:33 GMT
nah i mean it that way, what if a module doesn't compile anymore due to kernel changes, which tends to happen quite often, then the old module is still installed but is useless.
Comment by Lone_Wolf (Lone_Wolf) - Friday, 20 July 2007, 19:11 GMT
How about this : depends=(kernel26=$_KERNEL_VER) ?
Comment by Tobias Powalowski (tpowa) - Friday, 20 July 2007, 19:12 GMT
very bad because not every new minor version needs module compile
Comment by Roman Kyrylych (Romashka) - Monday, 23 July 2007, 15:53 GMT
IMO any change proposed will cause more bad than good.
I still think that IgnorePkg is the best way.
Sure, we can introduce major kernel version in package names (something like kernel.22-$pkgver-$pkgrel and madwifi.22-$pkgver-$pkgrel) but that's very ugly.
Comment by Lone_Wolf (Lone_Wolf) - Tuesday, 24 July 2007, 10:37 GMT
With IgnorePkg users have to find out themselves which packages depend on the kernel and add all of them to the IgnorePkg list.
On my laptop fglrx and madwifi depend on kernel26 .
In order to block 1 package (kernel26) and keep a working system i need to add 3 packages to IgnorePkg.
That's hardly KISS and the kind of problem pacman should take care of.

The best solution imo :
Find an easy way to include the MAJOR kernel version in package dependencies.
- Add kernel26 to IgnorePkg
- Pacman makes sure you don't install packages build for another kernel.

It seems the problem lies in finding that easy way.
Comment by dtw (dibblethewrecker) - Tuesday, 24 July 2007, 10:51 GMT
Technically it's not hard at all, you just need a var in each pkgbuild called _KERMAJVER= and then depends>=$_KERMAJVER

AFAIK pacman knows that kernel26-2.6.22.1 is >= kernel26-2.6.22 - so that should cover it.

However, I do now see the problem. With depends>= the dependency will still be fulfilled when the kernel is upgraded, which makes no sense because the module will actually break. Sadly, I don't think either way makes more sense than the other.

What about depends=('kernel26=2.6.22*') - will that work?
Comment by Roman Kyrylych (Romashka) - Tuesday, 24 July 2007, 11:24 GMT
depends=('kernel26=2.6.22*') looks good, though AFAIK it's not supported by pacman (yet).
Comment by dtw (dibblethewrecker) - Tuesday, 24 July 2007, 11:41 GMT
What about a new option? depends>=<x.y.z with the meaning of depends=x.y.z* - that would basically mean "any equal to but no greater than the given (major) version"

That'd work for more than just the kernel for anything that branches on . versions, you could depend on one branch very easily.
Comment by Roman Kyrylych (Romashka) - Tuesday, 24 July 2007, 11:55 GMT
hm, IIRC there was one feature request about more complex version comparison in depends, but I cannot find it now.
Feel free to open new feature request for this in Pacman project.
Comment by Jan de Groot (JGC) - Tuesday, 24 July 2007, 14:40 GMT
Well, IMHO we should have something like this:

depends=('kernel26>=2.6.22' 'kernel26<2.6.23')

I don't know how pacman handles it, but it would be the most logical way. Other option is to support versioned conflicts, which isn't possible at this moment.
Comment by dtw (dibblethewrecker) - Friday, 27 July 2007, 12:42 GMT
This is a good example of why something should be done about dependencies between modules and kernels.
http://bbs.archlinux.org/viewtopic.php?pid=268908#p268908
Comment by Travis Willard (Cerebral) - Saturday, 03 November 2007, 14:39 GMT
I've run a couple tests. Current pacman doesn't seem to support strictly-less-than dependencies, however it supports the following:

_kernel_version=2.6.23
depends=("kernel26>=${_kernel_version}a" "kernel26<=${_kernel_version}.9999")

Reasoning: "kernel26>=${_kernel_version}a" would be needed to handle any rc kernels, since 2.6.23rc1 is considered less-than 2.6.23, however it's considered greater-than 2.6.23a.
"kernel26<=${_kernel_version}.9999" may seem hackish, but let's pretend .23.9999 exactly equals .24 since I really doubt anyone will get to 9999 incremental releases of a kernel.

This would work as we want, guarding against an improper kernel version.


Thoughts?
Comment by Tobias Powalowski (tpowa) - Saturday, 26 January 2008, 16:04 GMT
it's implemented in pacman 3.1 and now added to all known modules, so we can close this

Loading...