scripts/kexec_related/kexec-latest.sh
2024-07-02 04:10:31 -05:00

12 lines
321 B
Bash
Executable file

#!/bin/bash
set -x
NEWEST_KERNEL_VERSION="$(
rpm --query --queryformat='%{VERSION}-%{RELEASE}.%{ARCH}\n' kernel \
| sort --version-sort --reverse \
| head --lines=1
)"
kexec --load --append="`cat /proc/cmdline`" \
--initrd="/boot/initramfs-$NEWEST_KERNEL_VERSION.img" \
"/boot/vmlinuz-$NEWEST_KERNEL_VERSION"