Please, how do I set systemd-boot/kernelstub (/boot/efi/loader/loader.conf) to remember last booted OS? In GRUB its easy by GRUB_SAVEDEFAULT=true ... but in POP! OS... How? Thanks!
- 762
- 3
- 10
- 24
3 Answers
Such feature/option is not implemented in systemd-boot, at least not entirely. You can at best press d to save the highlighted entry as conf-overriding default in an EFI variable. If you want "last as default" to happen you need to press d every time before Enter.
It shouldn't be too hard to implement, although I am not sure if upstream want to have such option, as they probably tend to keep systemd-boot simple.
Besides, you can always use grub instead.
- 9,075
- 2
- 17
- 36
-
I am aware I may use GRUB instead, but... why? I like the idea of having simple EFI boot loader... I believe adding this would not jeopardize the simplicity philosophy in any way, it is very convenient to have the laptop boot last-used OS. Thanks for the "d" trick, unfortunately, this does not solve the problem in case of planned restarts etc :( I've asked here, too https://chat.pop-os.org/community/channels/support – crysman Apr 03 '21 at 22:04
-
You can always try to file a feature request (or even open a pull request with your own patch) on the systemd github repo. – Tom Yan Apr 03 '21 at 22:08
That's the neat part: You don't.
We do not want to write to the EFI variables unless such action is explicitly requested by the user. The EFI variable store is fragile on some machines and it should not be touched by any action during normal operations.
There is the d key for for default, to set the default manually.
https://github.com/systemd/systemd/issues/477#issuecomment-118436201
Your best bet would be to install GRUB2.
- 186
- 11
This has been implemented by setting
default @saved
in the loader.conf and running bootctl install
see https://man.archlinux.org/man/loader.conf.5#OPTIONS or man loader.conf for details.
- 181
- 1
- 4
-
I've just tried it and no luck :( It just boots Windows unfortunately. I'm on systemd 249 (249.11-0ubuntu3.7pop1~1686173093~22.04~4514189) – crysman Jun 12 '23 at 06:00
-
I'm on EndevourOS with systemd 253.5-1. I also have a package called `kernel-install-for-dracut` version 1.7-5, which has a description of "Enables systemd-boot automation using kernel-install with dracut". I wonder if that's the missing link. I did find this comment in the systemd repo that talks about doing it on PopOS: https://github.com/systemd/systemd/issues/477#issuecomment-1406788175 . perhaps that will help? – opennomad Jun 13 '23 at 16:24