Add reboot with BootNext

This commit is contained in:
Jan Schär 2025-03-08 16:56:37 +01:00
parent 6c8705b8cd
commit bee5eb3984
3 changed files with 34 additions and 10 deletions

View file

@ -2,13 +2,9 @@
set -eu
# Reboot with kexec.
# This has the advantage that we don't need to go through the system boot menu,
# which is especially useful when the boot menu is password protected.
# However, we currently can't preserve the squashfs in RAM across kexec,
# so the boot USB stick needs to be plugged in before rebooting.
kexec --kexec-file-syscall --load /vmlinuz --initrd=/initrd.img --append="$(cat /proc/cmdline)"
# Set dark color scheme, as a way to mark machines which have not been rebooted
# yet. This should make it less likely to forget to reboot some machines.
runcontestant gsettings set org.gnome.desktop.interface color-scheme prefer-dark
if runcontestant zenity --question --title="Reboot?" --text="Press Enter after inserting the boot USB stick."
then