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:
Michael Brown
2006-12-20 07:04:08 +00:00
parent 9ab17484d0
commit 84202d89f0
7 changed files with 85 additions and 14 deletions

View 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,
};