Biosias / uefi-mkconfig

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

v2.0: no entries added #16

Closed Nowa-Ammerlaan closed 4 months ago

Nowa-Ammerlaan commented 4 months 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 4 months 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.

Nowa-Ammerlaan commented 4 months 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

Nowa-Ammerlaan commented 4 months ago

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

Biosias commented 4 months 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 4 months ago

Indeed automated testing is the next thing on my list

Nowa-Ammerlaan commented 4 months 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 4 months 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 4 months ago

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

Biosias commented 4 months ago

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

Biosias commented 4 months ago

Merged PR with fix