Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 719912 - sys-kernel/gentoo-kernel-bin improvements for better workflow
Summary: sys-kernel/gentoo-kernel-bin improvements for better workflow
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Distribution Kernel Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-28 09:38 UTC by Hoess
Modified: 2020-04-29 06:58 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hoess 2020-04-28 09:38:37 UTC
Perhaps the following improvements could be considered:

1.) Call emerge @module-rebuild after installing the kernel:
Some of my machines use ZFS, so it would be nice if installing 
an updated kernel would also trigger "emerge @module-rebuild" so 
when the new initramfs is built all required modules are available

2.) Support for genkernel as alternative for dracut. 
"genkernel initramfs" built an usable initramfs for gentoo-kernel-bin
w/o problems. And it eases the migration for users coming from 
self-compiled-kernels with genkernel to gentoo-kernel-bin 
(also with custom kernel parameters for e.g. ZFS)

3.) Call grub-mkconfig, so the new kernel is avail in the bootloader.

Those features could be controlled with extra useflags ("module-reuild", "genkernel", "grub")

Currently I use gentoo-kernel-bin with use-flag "-initramfs" 
and have to call a "quick and dirty" script afterwards which does all
this steps manually.
Comment 1 Ionen Wolkens gentoo-dev 2020-04-28 14:17:00 UTC
I think /etc/kernel/postinst.d is more suitable for setting up bootloader given how much that can vary per user (arg1 is kernel version, arg2 is kernel path -- called by installkernel-gentoo). Personally use it to setup my EFI stub locations, and it gets used even on my binpkg-only host.

Something that would force rebuilds of modules is something I'd like though. It's a just-for-me hack but nvidia-drivers in my local overlay is auto-modified to add a RDEPEND="sys-kernel/gentoo-kernel:=" so new slots trigger rebuild (not that this work when rebuilding same kernel). But I have no idea what would be a good way to implement something similar for all users/modules, this approach has problems.

With both of those I never have to care when gentoo-kernel is bumped (I don't use -bin myself) and it's all automated during @world update with no additional actions / wrappers.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-04-29 06:34:53 UTC
(In reply to Hoess from comment #0)
> Perhaps the following improvements could be considered:
> 
> 1.) Call emerge @module-rebuild after installing the kernel:
> Some of my machines use ZFS, so it would be nice if installing 
> an updated kernel would also trigger "emerge @module-rebuild" so 
> when the new initramfs is built all required modules are available

You can't call emerge inside emerge.  I never found any technical possibility for this happening.  Well, except using subslots that would mean premature rebuilds for users not using gentoo-kernel*.

> 2.) Support for genkernel as alternative for dracut. 
> "genkernel initramfs" built an usable initramfs for gentoo-kernel-bin
> w/o problems. And it eases the migration for users coming from 
> self-compiled-kernels with genkernel to gentoo-kernel-bin 
> (also with custom kernel parameters for e.g. ZFS)

I'm not willing to put additional effort into providing another initramfs.  Dracut just works, genkernel not necessarily.  We'll using Arch Linux configs, so using the same initramfs as they do makes sense.

> 3.) Call grub-mkconfig, so the new kernel is avail in the bootloader.
> 
> Those features could be controlled with extra useflags ("module-reuild",
> "genkernel", "grub")
> 
> Currently I use gentoo-kernel-bin with use-flag "-initramfs" 
> and have to call a "quick and dirty" script afterwards which does all
> this steps manually.

The kernels rely on installkernel doing the right thing.  If you're using installkernel-debian, /etc/kernel/postinst.d is your directory.  You may want to ask grub2 people to drop something there but please file a separate bug for that.
Comment 3 Hoess 2020-04-29 06:58:27 UTC
Thanks for your comments. I will stick to my custom post-emerge-script then. But it's already a huge improvement having gentoo-kernel(-bin) and not have to go through all the kernel-config by myself on new releases.