Project Talk:Distribution Kernel
Before creating a discussion or leaving a comment, please read about using talk pages. To create a new discussion, click here. Comments on an existing discussion should be signed using
~~~~:
A comment [[User:Larry|Larry]] 13:52, 13 May 2024 (UTC) : A reply [[User:Sally|Sally]] 13:26, 4 September 2026 (UTC) :: Your reply ~~~~
Supported tracks
The supported tracks need to be updated. Or maybe just removed so they no longer need to be updated? :)
— The preceding unsigned comment was added by Kobboi (talk • contribs) 2021年11月07日
- Done. Made it for rarer updates now. Michał Górny (talk) 08:05, 7 November 2021 (UTC)
Hook directory
The page advises to "use a hook in /etc/kernel/install.d/ to automatically update GRUB" but that didn't work for me. sys-kernel/installkernel-gentoo uses /etc/kernel/postinst.d instead. Is /etc/kernel/install.d/ specific to sys-kernel/installkernel-systemd-boot?
— The preceding unsigned comment was added by Tastytea (talk • contribs) 2022年02月08日
- The grub update is handled by the now stable sys-kernel/installkernel-gentoo [grub] which installs a script into postinst.d. --Tastytea (talk) 13:17, 2 April 2022 (UTC)
initramfs
I don't have access to edit the main page, but it was complained to me that an "initramfs" section should be added, explaining that the "initramfs" USE flag is available, its on by default, and REQUIRES use of dracut to auto-generate it. A link could also be added to the Initramfs section, but its unclear to me if anything on those sub-pages are directly relevant to how the initramfs works with the dist-kernel. I'm not sure how to deal with the overall repeated information but only show what is applicable.
— The preceding unsigned comment was added by Genr8 (talk • contribs) 2022年04月02日
While gentoo-kernel-bin is not mentioned much in the wiki as it actually should be a ready-to-use kernel with universal configuration, there is no description about the USE=initramfs there. However some
emerge sys-kernel/gentoo-kernel-bin
did
dracut: *** Creating image file '/usr/src/linux-5.15.52-gentoo-dist/arch/x86/boot/initrd' *** dracut: *** Creating initramfs image file '/usr/src/linux-5.15.52-gentoo-dist/arch/x86/boot/initrd' done *** [ ok ] * Installing the kernel via installkernel ... [ ok ] >>> sys-kernel/gentoo-kernel-bin-5.15.52 merged.
while
dracut --force --kver 5.15.52-gentoo-dist
did create /boot/initramfs-5.15.52-gentoo-dist.img but still not symlinked. Shouldn't the emerge leave a ready kernel in /boot and also symlinking the initramfs like it does with System.map, vmlinuz and config? If emerge should install and activate a kernel it should also call
grub-mkconfig -o /boot/grub/grub.cfg
by some USE=grub switch, no?
--Massimo B. (talk) 12:32, 4 August 2022 (UTC)
Detailed Information Page
"See the AMD64 Handbook for more details." Shouldn't be the opposite? For more details about 'Distribution Kernel' the user must visit the dedicated wiki page (this one). And it's not clear what info is more detailed in Handbook: installing A Distribution Kernel, Create a hook to run grub-mkconfig, best fit between gentoo-kernel and gentoo-kernel-bin.
Add example for using install.d hook
I would suggest adding an example and changing the relevent paragraph like this:
Users of systemd-boot should have the kernel installed automatically into /boot, while users of e.g. GRUB will need to run grub-mkconfig after installation completes. It is possible to use a hook in /etc/kernel/install.d/ to automatically update GRUB or run arbitrary commands at the point of kernel installation. For example, creating the following file will mount the boot partition, update GRUB and unmount the boot partition:
/etc/kernel/install.d/grubmount /boot grub-mkconfig -o /boot/grub/grub.cfg umount /boot
Ran.Rutenberg (talk) 15:14, 7 January 2023 (UTC)
- Nowadays, grub users can enable USE=grub on sys-kernel/installkernel-gentoo which handles this for you. --Sam (talk) 09:28, 18 August 2023 (UTC)
Elaborate more on how to generate /etc/kernel/config.d/*.config files
If one wants to generate such *.config files efficiently, generate customized .config file as mentioned in above section, "Preparing a modified kernel config". This way now there will be two files, .config.old & .config in directory /var/tmp/portage/sys-kernel/gentoo-kernel-5.9.8/work/modprep/. Run following command to save your customizations in /etc/kernel/config.d/my-kernel.config
root #cd /var/tmp/portage/sys-kernel/gentoo-kernel-5.9.8/work/modprep/
root #diff --changed-group-format="%>" --unchanged-group-format="" .config.old .config | tee -a /etc/kernel/config.d/my-kernel.config
Rahil (talk) 15:02, 3 August 2023 (UTC)
- Thanks for the tip! Done in Special:Diff/1256388. --Sam (talk) 09:32, 18 August 2023 (UTC)
Kernel script for above gen of .config snippets
If one wants to generate .config snippets for /etc/kernel/config.d/*.config , there is an easier script. in the kernel build dir, scripts/diffconfig is a script which can do the same, easier. Plz modify this according to needs of the wiki
root #cd $(portageq envvar PORTAGE_TMPDIR)/portage/sys-kernel/gentoo-kernel-5.9.8/work/modprep/
root ## View the differences for .config and .config.old
root #scripts/diffconfig
root ## for other files, filenames to be placed in this order
root #scripts/diffconfig .config .config.old
root #scripts/diffconfig -m # actual 'merge' type diff
root #scripts/diffconfig -m .config .config.old
root ## required here
root #scripts/diffconfig -m | tee -a /etc/kernel/config.d/my-kernel.config
- Thanks for the suggestion! That section has been moved to Distribution Kernel, which now uses diffconfig. — Waldo Lemmer 13:36, 10 June 2026 (UTC)
Clarify that /efi is also a supported boot partition
Suggest that:
Users of systemd-boot should have the kernel installed automatically into /boot.
changes to:
Users of systemd-boot should have the kernel installed automatically into /efi or /boot (depending on your boot partitioning choices).
Reading it for the first time sent me on a wild goose hunt trying to confirm if /efi would be used instead of /boot (as I needed). The only way to find out was to install (and wait on the compile!:) --Jusko (talk) 19:09, 6 March 2025 (UTC)
Elaborate on the permissions required on /etc/kernel/config.d and the snippets
A few days ago, I've had issues getting my config snippets to be taken into account by the kernel build process, as related in this forum thread. In the end, it turns out the problem was due to permissions being too restrictive on both the "/etc/kernel/config.d" directory, and the snippets themselves. Permissions were given to root only for both, when config.d needed r and x for all users, and the snippet needed to be world-readable.
I feel like this should be mentioned in the article, especially since currently, if config.d doesn't have the right permissions, the distribution kernel ebuild doesn't output its failure to access the directory and the snippets aren't being pulled in, giving the impression that snippets are being completely ignored by the building process and making the issue difficult to troubleshoot. --Ermor (talk) 16:25, 29 June 2025 (UTC)