Project Talk:Distribution Kernel

From Gentoo Wiki
Jump to:navigation Jump to:search
Note
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]] 09:29, 5 November 2024 (UTC)
:: Your reply ~~~~

Supported tracks

Talk status
This discussion is done as of 2022-04-02.

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 (talkcontribs) 2021-11-07

Done. Made it for rarer updates now. Michał Górny (talk) 08:05, 7 November 2021 (UTC)

Hook directory

Talk status
This discussion is done as of 2022-04-02.

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 (talkcontribs) 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

Talk status
This discussion is still ongoing.

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 (talkcontribs) 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

CODE
emerge sys-kernel/gentoo-kernel-bin

did

CODE
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

CODE
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

CODE
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

Talk status
This discussion is still ongoing.

"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

Talk status
This discussion is done.

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:

FILE /etc/kernel/install.d/grub
mount /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

Talk status
This discussion is done.

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

Talk status
This discussion is still ongoing.

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

PramodVU