Fall back to kexec when no kexec binary exists

This may be not a popular setup, but in case kexec resides somewhere different
than the default location for KEXEC (`/usr/sbin/kexec`), don't just reboot and
try doing `reboot(RB_KEXEC)` instead, just like what `kexec -e` normally does.
This commit is contained in:
Arusekk 2020-03-22 10:41:18 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent cdc6c95737
commit 71180f8e57

View file

@ -547,6 +547,9 @@ int main(int argc, char *argv[]) {
/* Child */
execv(args[0], (char * const *) args);
/* execv failed (kexec binary missing?), so try simply reboot(RB_KEXEC) */
(void) reboot(cmd);
_exit(EXIT_FAILURE);
}