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.
This commit is contained in:
Jan Janssen
2022-01-10 21:34:12 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent 3f3d4b4167
commit 9818ec8ea5
2 changed files with 33 additions and 23 deletions
+4 -4
View File
@@ -501,10 +501,10 @@
considered 'good' from then on.</para>
<para>The boot menu takes the 'tries left' counter into account when sorting the menu entries: entries in 'bad'
state are ordered at the beginning of the list, and entries in 'good' or 'indeterminate' at the end. The user can
freely choose to boot any entry of the menu, including those already marked 'bad'. If the menu entry to boot is
automatically determined, this means that 'good' or 'indeterminate' entries are generally preferred (as the bottom
item of the menu is the one booted by default), and 'bad' entries will only be considered if there are no 'good' or
state are ordered towards the end of the list, and entries in 'good' or 'indeterminate' towards the beginning.
The user can freely choose to boot any entry of the menu, including those already marked 'bad'. If the menu entry
to boot is automatically determined, this means that 'good' or 'indeterminate' entries are generally preferred as
boot entries are tried in sort order, and 'bad' entries will only be considered if there are no 'good' or
'indeterminate' entries left.</para>
<para>The <citerefentry><refentrytitle>kernel-install</refentrytitle><manvolnum>8</manvolnum></citerefentry> kernel