Skip to content
Snippets Groups Projects
Commit 37cb3ebe authored by Seblu's avatar Seblu
Browse files

reexec: support systemd-boot initrd paths

parent 3aadd809
No related branches found
No related tags found
No related merge requests found
......@@ -28,8 +28,13 @@ kernels=( /boot/vmlinuz-*(Nom) /boot/"$machineid"/*/linux(Nom) )
(( ${#kernels[@]} > 0 )) || { echo "No kernel found." >&2; exit 2; }
select kernel in "${kernels[@]}"; do
if [[ -e /boot/initramfs-${kernel#*-}.img ]]; then
if [[ -e "${kernel%/linux*}/initrd" ]]; then
initrd="--initrd=${kernel%/linux*}/initrd"
elif [[ -e "${kernel%/vmlinuz*}/initramfs${kernel##*/vmlinuz}.img" ]]; then
initrd="--initrd=/boot/initramfs-${kernel#*-}.img"
else
echo 'No initrd detected. Press a key to continue?'
read key
fi
kexec -l --reuse-cmdline "$initrd" "$kernel"
systemctl kexec
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment