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

v2.0: no entries added #16

Closed AndrewAmmerlaan closed 1 month ago

AndrewAmmerlaan commented 1 month ago

This configuration results in no added entries:

/efi/EFI/Gentoo/kernel-6.9.9-gentoo-dist.efi
/efi/EFI/Gentoo/initramfs-6.9.9-gentoo-dist.img
/efi/EFI/Gentoo/intel-uc.img
/efi/EFI/Linux/linux-6.9.9-gentoo-dist.efi

Note it does work if we have only the UKI, it is adding the efistub variant that causes things to break.

Biosias commented 1 month ago

Ah so the entry is not created only for the UKI? I misunderstood what you wrote in the PR and thought no entry was added.

If this is the case the fix is trivial, uefi-mkconfig just doesn't have "linux-" in the list of prefixes the image can have.

AndrewAmmerlaan commented 1 month ago

UKI: uki entry is added

UKI + efisub: no entries are added

If this is the case the fix is trivial, uefi-mkconfig just doesn't have "linux-" in the list of prefixes the image can have.

It does because "linux" is my /etc/kernel/entry-token

AndrewAmmerlaan commented 1 month ago

I think it would be very useful to make some testing mode and add there some test cases.

Biosias commented 1 month ago

can you cat /etc/kernel/entry-token so I can see how it looks? To see if the script is parsing values correctly

Biosias commented 1 month ago

Indeed automated testing is the next thing on my list

AndrewAmmerlaan commented 1 month ago
cat /etc/kernel/entry-token
linux

That is not the problem I think, I think it's something with looping, sorting, or finding.

Biosias commented 1 month ago

If this is not causing your problem, I have found another bug.

 * Running uefi-mkconfig...
 * Using kernel commands from "/etc/default/uefi-mkconfig"
 * Warning! Loaded empty uefi-mkconfig configuration file!
/etc/os-release: line 1: linux: command not found
vmlinuz vmlinux- kernel- bzImage zImage -
 * Warning! Kernel command "root=" is missing from loaded configuration!
 * Ignoring "/boot/test/vmlinuz-6.8.9-gentoo-old.efi" on "nvme0n1p1"
 * Ignoring "/boot/test/vmlinuz-6.8.9-gentoo.efi" on "nvme0n1p1"
 * Ignoring "/boot/EFI/Gentoo/vmlinuz-6.9.2-gentoo-dist.efi" on "nvme0n1p1"
 * Ignoring "/boot/EFI/Gentoo/vmlinuz-6.9.3-gentoo-dist.efi" on "nvme0n1p1"
 * Ignoring "/boot/EFI/Gentoo/vmlinuz-6.9.4-gentoo-dist.efi" on "nvme0n1p1"
 * Ignoring "/boot/EFI/Gentoo/vmlinuz-6.9.5-gentoo-dist.efi" on "nvme0n1p1"
 * Ignoring "/boot/EFI/Gentoo/vmlinuz-6.9.6-gentoo-dist.efi" on "nvme0n1p1"
 * Creating UEFI entry "0200" for "/boot/EFI/Gentoo/vmlinuz-6.9.8-gentoo-dist.efi" found on "nvme0n1p1"
 * Creating UEFI entry "01FF" for "/boot/EFI/Gentoo/vmlinuz-6.9.9-gentoo-dist.efi" found on "nvme0n1p1"
 * Done

Sorry just noticed you've mentioned /etc/kernel/entry-token not /etc/os-release.

...however it reaaally is not good that uefi-mkconfig executes anything in /etc/os-release as command with root.

Biosias commented 1 month ago

Ok found the problem. It was indeed related to the find command

Biosias commented 1 month ago

Could you please test code from #18 when you'll have time ?

Biosias commented 1 month ago

Merged PR with fix