UbayGD/reboottouefi

[Feature request] Add other "reboot to..." options

Opened this issue · 4 comments

I know the name of the extension is self-explanatory, but it would be very useful to query and list all available boot options using org.freedesktop.login1.Manager as in the "reboot to..." (now dead) fork to use the bootloader selection feature in systemd-boot and some other bootloaders.
This feature can be made configurable (show UEFI or dual boot option only, rename some "ugly" bootloader entry names or hide some entries).

Hello!

It is true that I would like to keep the extension true to its name but I also understand what the problem is with that outdated fork.

I will see if there is a way to contact that person to see if they can update it with the latest. And if not, I will surely consider the option of including what you propose.

As I did not get an answer to this issue I was going to start with the development of the whole part related to the other boot options.
But a few days ago I discovered (and by chance) that when rebooting normally, when the modal appears, if you hold down the ALT key it gives you the option to reboot directly to GRUB.

So I don't know how useful it will be to add the boot options in the extension. I guess for people with bluetooth keyboard it would be great (which happens to me).

I think in a few days I will start testing and if I like it, I will merge and update the extension.

if you hold down the ALT key it gives you the option to reboot directly to GRUB

You mean "go to top-right corner, open Shutdown menu, select Reboot with Alt pressed"? I it's a rather non-obvious feature and many users will prefer the much more obvious current extension way.

This FR is intended to ask you to reproduce systemctl reboot --boot-loader-entry=something, as this is a pretty useful feature for dual-boot (or multi-kernel) users with "One-shot entry control"-capable bootloader installed (rEFInd, Systemd-Boot) - this allows you to reboot to a different OS in one click, preventing the need to select an OS (boot options, kernel) in the bootloader

Edit: this will not change the bootloader, this will make bootloader use provided boot entry as default for next boot only

This might be helpful:
dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.DBus.Properties.Get string:"org.freedesktop.login1.Manager" string:"BootLoaderEntries" can be used to retrieve all available boot entries from DBus for debug purposes:

➜ dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.DBus.Properties.Get string:"org.freedesktop.login1.Manager" string:"BootLoaderEntries"
   variant       array [
         string "linux-6.6.31-1-lts-64b8c389720b47ce827a76fbe827ae2f-rolling.efi"
         string "linux-6.9.1-arch1-1-64b8c389720b47ce827a76fbe827ae2f-rolling.efi"
         string "memtest.conf"
         string "auto-windows"
         string "auto-efi-shell"
         string "auto-reboot-to-firmware-setup"
      ]

These ids correspond to those which can be retrieved using bootctl list if Systemd-Boot is used:

         type: Boot Loader Specification Type #2 (.efi)
        title: Arch Linux (linux-lts)
           id: linux-6.6.31-1-lts-64b8c389720b47ce827a76fbe827ae2f-rolling.efi
       source: /efi//EFI/Linux/linux-6.6.31-1-lts-64b8c389720b47ce827a76fbe827ae2f-rolling.efi
     sort-key: arch
      version: linux-lts
        linux: /efi//EFI/Linux/linux-6.6.31-1-lts-64b8c389720b47ce827a76fbe827ae2f-rolling.efi
      options: init=/usr/lib/systemd/systemd quiet loglevel=3 rd.systemd.show_status=auto rd.ude>

         type: Boot Loader Specification Type #2 (.efi)
        title: Arch Linux (linux) (default) (selected)
           id: linux-6.9.1-arch1-1-64b8c389720b47ce827a76fbe827ae2f-rolling.efi
       source: /efi//EFI/Linux/linux-6.9.1-arch1-1-64b8c389720b47ce827a76fbe827ae2f-rolling.efi
     sort-key: arch
      version: linux
        linux: /efi//EFI/Linux/linux-6.9.1-arch1-1-64b8c389720b47ce827a76fbe827ae2f-rolling.efi
      options: init=/usr/lib/systemd/systemd quiet loglevel=3 rd.systemd.show_status=auto rd.ude>

         type: Boot Loader Specification Type #1 (.conf)
        title: MemTest86
           id: memtest.conf
       source: /efi//loader/entries/memtest.conf
          efi: /efi//EFI/tools/memtest86.efi

         type: Automatic
        title: Windows Boot Manager
           id: auto-windows
       source: /sys/firmware/efi/efivars/LoaderEntries-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f

         type: Automatic
        title: EFI Shell
           id: auto-efi-shell
       source: /sys/firmware/efi/efivars/LoaderEntries-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f

         type: Automatic
        title: Reboot Into Firmware Interface
           id: auto-reboot-to-firmware-setup
       source: /sys/firmware/efi/efivars/LoaderEntries-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f

IDK does Grub support this interface or not, so I can help you with testing if needed.