Biosias / uefi-mkconfig

grub-mkconfig inspired script for automatically managing uefi entries for booting linux kernel directly without bootloader
Apache License 2.0
7 stars 3 forks source link

No initrd= for static version-less copy of kernel #21

Closed AndrewAmmerlaan closed 2 weeks ago

AndrewAmmerlaan commented 1 month ago

sys-kernel/installkernel[-systemd] has the capability of updating a version-less copy of the kernel when installing the kernel.

For example:

-rwxr-xr-x 1 root root   266825 Jul 25 09:07 config-6.6.40-gentoo-dist
-rwxr-xr-x 1 root root   266825 Jul 25 09:05 config-6.6.41-gentoo-dist
-rwxr-xr-x 1 root root   266825 Jul 25 09:05 config-6.6.41-gentoo-dist.old
-rwxr-xr-x 1 root root 19851537 Jul 25 09:07 initramfs-6.6.40-gentoo-dist.img
-rwxr-xr-x 1 root root 19851610 Jul 25 09:05 initramfs-6.6.41-gentoo-dist.img
-rwxr-xr-x 1 root root 19851610 Jul 25 09:05 initramfs-6.6.41-gentoo-dist.img.old
-rwxr-xr-x 1 root root 19851537 Jul 25 09:07 initramfs.img
-rwxr-xr-x 1 root root 19851610 Jul 25 09:07 initramfs.img.old
-rwxr-xr-x 1 root root  9407839 Jul 25 09:07 System.map-6.6.40-gentoo-dist
-rwxr-xr-x 1 root root  9407694 Jul 25 09:05 System.map-6.6.41-gentoo-dist
-rwxr-xr-x 1 root root  9407694 Jul 25 09:05 System.map-6.6.41-gentoo-dist.old
-rwxr-xr-x 1 root root 15703024 Jul 25 09:07 vmlinuz-6.6.40-gentoo-dist.efi
-rwxr-xr-x 1 root root 15698928 Jul 25 09:05 vmlinuz-6.6.41-gentoo-dist.efi
-rwxr-xr-x 1 root root 15698928 Jul 25 09:05 vmlinuz-6.6.41-gentoo-dist-old.efi
-rwxr-xr-x 1 root root 15703024 Jul 25 09:07 vmlinuz.efi
-rwxr-xr-x 1 root root 15698928 Jul 25 09:06 vmlinuz-old.efi

If the files without a version are found, the versioned installed file is copied there.

Uefi-mkconfig finds these files and does create an entry for them, but for specifically vmlinuz.efi the initrd=initramfs.img is missing. For vmlinuz-old.efi it does work correctly:

BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 01F7,01F8,01F9,01FA,01FB,01FC,01FD,01FE,01FF,0200,0002,0006,0001,0000,0008,0007
Boot0000* Linux Boot Manager    HD(1,GPT,7ae430c6-07e8-3b4e-a796-b2a28706b3fb,0x800,0x100800)/File(\EFI\SYSTEMD\SYSTEMD-BOOTX64.EFI)
Boot0001* Windows Boot Manager  HD(1,GPT,3bed0f92-bec1-11ec-9467-98b2f623c3c1,0x800,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)䥗䑎坏S
Boot0002* UEFI OS       HD(1,GPT,7ae430c6-07e8-3b4e-a796-b2a28706b3fb,0x800,0x100800)/File(\EFI\BOOT\BOOTX64.EFI)
Boot0006* Windows Boot Manager  HD(1,GPT,7ae430c6-07e8-3b4e-a796-b2a28706b3fb,0x800,0x100800)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)
Boot0007* UEFI: PXE IP4 Realtek PCIe GBE Family Controller      PciRoot(0x0)/Pci(0x1c,0x3)/Pci(0x0,0x0)/MAC(309c23aebbb1,0)/IPv4(0.0.0.00.0.0.0,0,0)
Boot0008* UEFI: PXE IP6 Realtek PCIe GBE Family Controller      PciRoot(0x0)/Pci(0x1c,0x3)/Pci(0x0,0x0)/MAC(309c23aebbb1,0)/IPv6([::]:<->[::]:,0,0)
Boot01F7* UMC /EFI/Gentoo/vmlinuz-6.6.41-gentoo-dist.efi on EFI System Partition        HD(1,GPT,7ae430c6-07e8-3b4e-a796-b2a28706b3fb,0x800,0x100800)/File(\EFI\Gentoo\vmlinuz-6.6.41-gentoo-dist.efi) initrd=\EFI\Gentoo\initramfs-6.6.41-gentoo-dist.img
Boot01F8* UMC /EFI/Gentoo/vmlinuz-6.6.40-gentoo-dist.efi on EFI System Partition        HD(1,GPT,7ae430c6-07e8-3b4e-a796-b2a28706b3fb,0x800,0x100800)/File(\EFI\Gentoo\vmlinuz-6.6.40-gentoo-dist.efi) initrd=\EFI\Gentoo\initramfs-6.6.40-gentoo-dist.img
Boot01F9* UMC /EFI/Gentoo/vmlinuz.efi on EFI System Partition   HD(1,GPT,7ae430c6-07e8-3b4e-a796-b2a28706b3fb,0x800,0x100800)/File(\EFI\Gentoo\vmlinuz.efi)
Boot01FA* UMC /EFI/Linux/linux-6.9.10-gentoo-dist.efi on EFI System Partition   HD(1,GPT,7ae430c6-07e8-3b4e-a796-b2a28706b3fb,0x800,0x100800)/File(\EFI\Linux\linux-6.9.10-gentoo-dist.efi)
Boot01FB* UMC /EFI/Linux/linux-6.9.9-gentoo-dist.efi on EFI System Partition    HD(1,GPT,7ae430c6-07e8-3b4e-a796-b2a28706b3fb,0x800,0x100800)/File(\EFI\Linux\linux-6.9.9-gentoo-dist.efi)
Boot01FC* UMC /EFI/Linux/linux-6.6.41-gentoo-dist.efi on EFI System Partition   HD(1,GPT,7ae430c6-07e8-3b4e-a796-b2a28706b3fb,0x800,0x100800)/File(\EFI\Linux\linux-6.6.41-gentoo-dist.efi)
Boot01FD* UMC /EFI/Linux/linux-6.6.40-gentoo-dist.efi on EFI System Partition   HD(1,GPT,7ae430c6-07e8-3b4e-a796-b2a28706b3fb,0x800,0x100800)/File(\EFI\Linux\linux-6.6.40-gentoo-dist.efi)
Boot01FE* UMC /EFI/Linux/linux-6.6.39-gentoo-dist.efi on EFI System Partition   HD(1,GPT,7ae430c6-07e8-3b4e-a796-b2a28706b3fb,0x800,0x100800)/File(\EFI\Linux\linux-6.6.39-gentoo-dist.efi)
Boot01FF* UMC /EFI/Gentoo/vmlinuz-old.efi on EFI System Partition       HD(1,GPT,7ae430c6-07e8-3b4e-a796-b2a28706b3fb,0x800,0x100800)/File(\EFI\Gentoo\vmlinuz-old.efi) initrd=\EFI\Gentoo\initramfs.img.old
Boot0200* UMC /EFI/Gentoo/vmlinuz-6.6.41-gentoo-dist-old.efi on EFI System Partition    HD(1,GPT,7ae430c6-07e8-3b4e-a796-b2a28706b3fb,0x800,0x100800)/File(\EFI\Gentoo\vmlinuz-6.6.41-gentoo-dist-old.efi) initrd=\EFI\Gentoo\initramfs-6.6.41-gentoo-dist.img.old
AndrewAmmerlaan commented 1 month ago

Alternatively we can simply skip these entries (meaning entries with no version).

These static files won't be updated unless the user manually created one in the first place, and since the path is static there is really no need for uefi-mkconfig to do anything with them. The user probably already created some UEFI entry for it manually.

As a side note, when testing be sure to apply this fix first: https://github.com/projg2/installkernel-gentoo/commit/f870ec003adb7b0c58b4005f64613a1583b7e6c7 (will release that as a new version soon)

Biosias commented 2 weeks ago

Hello!

Alternatively we can simply skip these entries (meaning entries with no version).

These static files won't be updated unless the user manually created one in the first place, and since the path is static there is really no need for uefi-mkconfig to do anything with them. The user probably already created some UEFI entry for it manually.

even though I think that all you said here is correct, I would fix it and leave it there. Just so the functionality is consistent and we don't have to make a list of exceptions.

So let's leave it on by default. Uefi-mkconfig has built in ignore functionality so if user wishes for it to be ignored, it is easy to do so. Not so much the other way around.

Biosias commented 2 weeks ago

Fix was merged