boot: Change boot entry sorting
authorJan Janssen <medhefgo@web.de>
Tue, 4 Jan 2022 12:00:37 +0000 (13:00 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 10 Jan 2022 20:34:12 +0000 (21:34 +0100)
commit9818ec8ea56e14902ac8e548a0f366dbb259f051
treed6de045c877ee750aeefce7ecc557022c7a6f98e
parent3f3d4b4167228571ee01bd7f9513248233bca517
boot: Change boot entry sorting

There are a few undesirable properties to how boot entries are
currently sorted.

First, it sorts by entry file name only, which may not correspond
to the title that is shown (for exmaple because it is prefixed by
machine-id). The file ending will also create unexpected ordering
("arch-lts.conf" would come before "arch.conf").

While the list is sorted alphabetically ascending, it is also
lower version/priority first, which is unintuitive. In particular,
a boot-counted entry that is bad (0 tries left) will be at the very
top.

Additionally, the Windows and Mac loaders should be sorted with
the rest of the loaders.
man/systemd-boot.xml
src/boot/efi/boot.c