-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
systemd version the issue has been seen with
v245
Used distribution
NixOS unstable
Expected behaviour you didn't see
The bootloader should select a default entry which does not have 0 tries left.
Unexpected behaviour you saw
The bootloader selected a default entry which has 0 tries left.
Steps to reproduce the problem
Place two entries, foo.conf and bar+0-3.conf into /boot/loader/entries.
Also ensure there is no default entry in /boot/loader/loader.conf and that the LoaderEntryDefault EFI var not set.
I would expect the entry corresponding to foo.conf to be selected by default. However, the entry corresponding to bar+0-3.conf is selected by default.
My understanding after reading https://systemd.io/AUTOMATIC_BOOT_ASSESSMENT/ is that bar+0-3.conf is considered "bad" because it has no tries left, and as a result, it would be ordered at the end of the list.
Implementing this, config_entry_compare from src/boot/efi/boot.c ensures that the entries which have no tries left will be ordered at the end of the list. But reading config_default_entry_select in this same file, it appears that the last suitable entry is selected, not the first suitable entry. As a result, entries which have no tries left would be selected by default.