17 lines
616 B
Plaintext
17 lines
616 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
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)"
|
||
|
|
||
|
if XDG_RUNTIME_DIR="/run/user/$(id -u contestant)" runuser -u contestant -- zenity --question --title="Reboot?" --text="Press Enter after inserting the boot USB stick."
|
||
|
then
|
||
|
reboot
|
||
|
fi
|