Files
server-config/scripts/server-kexec.sh
Floweynt 76fa38e34c
flake-check / flake-check (push) Canceled after 0s
lint / lint (push) Canceled after 0s
diff-tag / dix (push) Canceled after 0s
initial commit
2026-08-31 08:41:45 -05:00

18 lines
444 B
Bash

SYSTEM=${1:-/nix/var/nix/profiles/system}
if [[ ! -e "$SYSTEM/kernel" ]]; then
echo "error: no kernel found at $SYSTEM" >&2
exit 1
fi
echo "kexec: loading $SYSTEM"
echo "kernel-params: $(cat "$SYSTEM/kernel-params")"
sudo kexec \
--load "$SYSTEM/kernel" \
--initrd="$SYSTEM/initrd" \
--command-line="$(cat "$SYSTEM/kernel-params") init=$SYSTEM/init"
echo "kexec: executing (systemd will stop services first)"
sudo systemctl kexec