mirror of
https://github.com/ipxe/ipxe
synced 2025-12-26 17:42:47 +03:00
Split the (quick hack) boot logic out from main.c to autoboot.c, add a
"boot" command to attempt booting from within the command shell, fall back to shell if boot fails for any reason.
This commit is contained in:
21
src/hci/commands/boot_cmd.c
Normal file
21
src/hci/commands/boot_cmd.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <vsprintf.h>
|
||||
#include <gpxe/command.h>
|
||||
#include <gpxe/autoboot.h>
|
||||
|
||||
static int boot_exec ( int argc, char **argv ) {
|
||||
|
||||
if ( argc != 1 ) {
|
||||
printf ( "Usage: %s\n"
|
||||
"Attempts to boot the system\n", argv[0] );
|
||||
return 1;
|
||||
}
|
||||
|
||||
autoboot();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct command boot_command __command = {
|
||||
.name = "boot",
|
||||
.exec = boot_exec,
|
||||
};
|
||||
Reference in New Issue
Block a user