diff options
Diffstat (limited to 'src/hci/commands/reboot_cmd.c')
| -rw-r--r-- | src/hci/commands/reboot_cmd.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/hci/commands/reboot_cmd.c b/src/hci/commands/reboot_cmd.c index 45d54cc2c..daef92dc0 100644 --- a/src/hci/commands/reboot_cmd.c +++ b/src/hci/commands/reboot_cmd.c @@ -27,6 +27,7 @@ #include <ipxe/reboot.h> FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); +FILE_SECBOOT ( PERMITTED ); /** @file * @@ -38,12 +39,16 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); struct reboot_options { /** Perform a warm reboot */ int warm; + /** Reboot to firmware setup */ + int setup; }; /** "reboot" option list */ static struct option_descriptor reboot_opts[] = { OPTION_DESC ( "warm", 'w', no_argument, struct reboot_options, warm, parse_flag ), + OPTION_DESC ( "setup", 's', no_argument, + struct reboot_options, setup, parse_flag ), }; /** "reboot" command descriptor */ @@ -59,6 +64,7 @@ static struct command_descriptor reboot_cmd = */ static int reboot_exec ( int argc, char **argv ) { struct reboot_options opts; + int flags = 0; int rc; /* Parse options */ @@ -66,13 +72,14 @@ static int reboot_exec ( int argc, char **argv ) { return rc; /* Reboot system */ - reboot ( opts.warm ); + if ( opts.warm ) + flags |= REBOOT_WARM; + if ( opts.setup ) + flags |= REBOOT_SETUP; + reboot ( flags ); return 0; } /** "reboot" command */ -struct command reboot_command __command = { - .name = "reboot", - .exec = reboot_exec, -}; +COMMAND ( reboot, reboot_exec ); |
