arch-kexec: Works for other kernels
This commit is contained in:
parent
8743082b21
commit
97b6cec7d1
|
@ -1,3 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
sudo kexec -l /boot/vmlinuz-linux --initrd=/boot/initramfs-linux.img --reuse-cmdline
|
||||
|
||||
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
|
||||
sudo systemctl kexec
|
||||
|
|
Loading…
Reference in a new issue