Browse Source

arch-kexec: Works for other kernels

master
Geoffrey Frogeye 3 months ago
parent
commit
97b6cec7d1
  1. 17
      config/scripts/arch-kexec

17
config/scripts/arch-kexec

@ -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…
Cancel
Save