bootctl: ignore the bootloader boot entries
authorGoffredo Baroncelli <kreijack@inwind.it>
Tue, 18 Jan 2022 18:32:35 +0000 (19:32 +0100)
committerGoffredo Baroncelli <kreijack@inwind.it>
Tue, 18 Jan 2022 18:32:35 +0000 (19:32 +0100)
commit9914d89b5162a7cd47ecb15e679b944d87fdf1e4
tree488b9c3c9a3546c42749d250056599ab41a4e121
parent8513c34bece0b0cd69cb8669e4751f0cd3d28b7e
bootctl: ignore the bootloader boot entries

When bootctl lists the boot entries, considers also the ones
returned by systemd-boot (via the efi LoaderEntries variable),
created at boot time.

Unfortunately this list may became incorrect if (e.g.) the user remove a
kernel package.

This patch changes this behaviour, so bootctl ignores some the
boot entries returned by systemd-boot.

In any case, bootctl still considers the 'auto-xxx' boot entries
listed below:

  Boot entrie name                 Title
  -----------------------------    ------------------------------
  auto-osx                         macOS boot loader
  auto-windows                     Windows Boot Manager
  auto-efi-shell                   EFI Shell
  auto-efi-default                 EFI Default Loader
  auto-reboot-to-firmware-setup    Reboot Into Firmware Interface

The other entries that systemd-boot synthetizes (e.g. the ones loaded from
/efi/loader/entries/<uuid>) can be synthetized by bootctl too, so no
information is lost.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
src/boot/bootctl.c