dotfiles/config/scripts/arch-kexec

19 lines
391 B
Plaintext
Raw Normal View History

2018-01-22 07:29:43 +00:00
#!/usr/bin/env bash
2021-10-17 12:30:38 +00:00
set -euxo pipefail
# Set variables
name="${1:-linux}"
kernel="/boot/vmlinuz-$name"
initrd="/boot/initramfs-$name.img"
# Test if required files are present
[ -f $kernel ]
[ -f $initrd ]
command -v kexec &> /dev/null
# Configure the next kernel to load
sudo kexec -l $kernel --initrd=$initrd --reuse-cmdline
# Gracefully restart on the next kernel
2018-01-22 07:29:43 +00:00
sudo systemctl kexec