Skip to content

Commit

Permalink
reexec: do not call kexec if not kernel/initrd loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
seblu committed Aug 18, 2015
1 parent 7944121 commit 47bf19c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion reexec
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ select kernel in "${kernels[@]}"; do
echo 'No initrd detected. Press a key to continue?'
read key
fi
kexec -l --reuse-cmdline "$initrd" "$kernel"
if ! kexec -l --reuse-cmdline "$initrd" "$kernel"; then
printf '\e[1;31mUnable to load kernel/initrd\e[0m\n' >&2
exit 42
fi
systemctl kexec
break
done

0 comments on commit 47bf19c

Please sign in to comment.