Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 626472 - linux-mod.eclass: build for specific kernel version
Summary: linux-mod.eclass: build for specific kernel version
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
Depends on:
Reported: 2017-07-28 17:28 UTC by Andreas Steinmetz
Modified: 2017-08-23 17:57 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Steinmetz 2017-07-28 17:28:57 UTC
emerge @module-rebuild rebuilds modules only for the current running kernel. This causes a double reboot for every new kernel. First compile and install the new kernel, then do a reboot. Second, execute emerge @module-rebuild and reboot again.

This is particularly bad as e.g. I do have a Laptop that refuses to display properly without the Nvidia drivers (using nouveau is not possibe due to Cuda requirements). Thus I do need a second system and remote access just to be able to do a kernel upgrade.

All modules I do need that are not within the Portage tree allow to specify either KVER or KSRC to build against a specific kernel.

A suggestion would be something like:
"emerge --kver=4.9.40-gentoo @module-rebuild"
Comment 1 Zac Medico gentoo-dev 2017-07-28 17:51:57 UTC
We'd need some kind of support in linux-mod.eclass for this.
Comment 2 Mike Gilbert gentoo-dev 2017-07-28 18:41:50 UTC
linux-info/linux-mod look at the KERNEL_DIR environment var to find a linux source tree to build against.

If you have set KERNEL_DIR to the new kernel source dir, or set the /usr/src/linux symlink, I would expect @module-rebuild to re-compile modules against the new kernel version, not the currently running kernel version.
Comment 3 Andreas Steinmetz 2017-07-28 19:14:01 UTC
Hmm, ok, the soft link version seems to work (tried with running 4.9.39 to build for 4.9.36) though I'm quite sure it didn't work the last time I tried this (well, quite some time ago).
Anyway, it would be nice if this behaviour would be documented somewhere, preferably the emerge man page.
Thanks for your patience.
Comment 4 Mike Gilbert gentoo-dev 2017-07-28 19:44:51 UTC
It's documented here.

It would be nice to have some user docs on this, but that probably belongs on the wiki rather than in any portage documentation.
Comment 5 Mike Pagano gentoo-dev 2017-08-23 17:57:40 UTC
Don't think there's anything for kernel team to do here.