[systemd-devel] systemd-boot, default entry and bootctl, oh my

Itxaka Serrano Garcia itxaka.garcia at spectrocloud.com
Tue Dec 10 09:56:58 UTC 2024


Hey all, me again with stupid questions regarding systemd-boot, yay!

seems like systemd-boot and bootctl do not agree on the default entries and
IDs for the entries somehow?

Scenario:

We got 2 entries, with boot assessment enabled. One was already marked as
good. We set the passive one as the default in the loader.conf

/efi//EFI/kairos/active.efi with conf at /efi//loader/entries/active.conf
/efi//EFI/kairos/passive.efi with conf at
/efi//loader/entries/passive+2-1.conf

bootctl shows the entry IDs as the conf name WITHOUT the assessment part:

         type: Boot Loader Specification Type #1 (.conf)
         title: Kairos (selected)
         id: active.conf
         source: /efi//loader/entries/active.conf
         sort-key: 0001
         efi: /efi//EFI/kairos/active.efi

         type: Boot Loader Specification Type #1 (.conf)
         title: Kairos (fallback) (default) (not reported/new)
         id: passive.conf
         source: /efi//loader/entries/passive+2-1.conf
         tries: 2 left; 1 done
         sort-key: 0002
         efi: /efi//EFI/kairos/passive.efi


Also as you can see, it marks the passive.conf ID as the default entry,
which is expected.

We can also check in the loader.conf and we see that we marked the entry ID
as the default entry:

editor no
secure-boot-enroll if-safe
default passive.conf
timeout 5
console-mode max

So I would expect that on reboot the passive entry is selected by default,
as it seems like you can refer to it by ID and bootctl agrees that this is
the default one, but as you can also see, it booted on the active entry
instead.

And in fact, if you do bootctl set-default {active.conf|passive.conf} it
does select the proper one, at least by reported by bootctl, but then
again, on reboot systemd-boot shows the active entry as the one selected by
default.

I'm baffled by this as I would expect this to work. Who is in the wrong
here? loader.conf? bootctl? Me???

Is this a side effect of using the efivars VS the loader.conf file?

Is this the assessment in play making the good entry be higher in the
selection? Or the sort key?

Does the loader.conf default entry refer to a file name or an ID?

Ideally if the entry ID is usable and without the assessment part, that
would be nice, which is what I expected by the bootctl workflow of showsing
and choosing an ID without the assessment part.


Any light show on this would be helpful!

Thanks!
Itxaka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20241210/0dd8c3e0/attachment.htm>


More information about the systemd-devel mailing list