TIL: If you have full-disk encryption with a key embedded in initrd (https://en.opensuse.org/SDB:Encrypted_root_file_system#Avoiding_to_type_the_passphrase_twice) you can easily use kexec (https://doc.opensuse.org/documentation/leap/tuning/html/book.sle.tuning/cha-tuning-kexec.html#cha-tuning-kexec-basic-usage) for fast and passwordless reboots.
@etam well, I had to remove the secure boot, which is kind of logical to make it work, after that, I had to manually load the kernel with kexec -l with my boot loader. It didn't pick it up automatically with systemctl kexec.
@lebel Turns out my error message was not the same. I had "Unable to get default section of bootloader configuration". I found that command `grub2-editenv list` returns `saved_entry=openSUSE Leap 15.1` with a space at the end. I used `grub2-editenv - set "saved_entry=openSUSE Leap 15.1"` and it works now.
@etam the wierd thing is that I have to do manually a systemctl start kexec-load, THEN, it'll pick up the kernel and "reboot" with systemctl kexec.
@lebel Do you? kexec-load.service has
So if you enable this service, it should be automatically started when doing `systemctl kexec`.
@lebel No. A target in systemd is something like a runlevel in sysV. There are some like "multi-user" (former level 3), "graphical" (level 5), "poweroff" (level 0), or reboot (level 6). Now kexec is as new target and "systemctl kexec" is a shortcut that switches to it (in systemd terminology it's called "isolating" a target).
If kexec-load.service is enabled for kexec.target, then it will be started when isolating the target.
@etam Hmm. As I said, after a boot, kexec-load doesn't seemed to be load, and I can't kexec, and I was able to successfully do a kexec-load and if I were to do a kexec, it'd work.
@lebel Oops. My bad. Indeed that's what happening. Looks like "systemctl kexec" is checking if there's a new kernel loaded before doing anything.
On the other hand, I just checked, that if you replace reboot.target with kexec.target (second link in my first post), then while rebooting with normal "reboot", it's loading kernel with kexec-load.service and doing kexec.
@etam Indeed! It does work with reboot. With kexec I still doesn't work complaining with
“No boot loader entry suitable as default, refusing to guess.”
But with reboot it does the whole thing correctly and reboot the laptop. It'll be handy when I want to reboot my laptop while I'm at work (I usually leave it on all the time).
A generalist Mastodon instance with a nice domain name. Running on Glitch Social's fork with a custom theme!