diff options
| author | Simon Rettberg | 2026-01-28 12:53:53 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2026-01-28 12:53:53 +0100 |
| commit | 8e82785c584dc13e20f9229decb95bd17bbe9cd1 (patch) | |
| tree | a8b359e59196be5b2e3862bed189107f4bc9975f /src/hci/commands/reboot_cmd.c | |
| parent | Merge branch 'master' into openslx (diff) | |
| parent | [prefix] Make unlzma.S compatible with 386 class CPUs (diff) | |
| download | ipxe-openslx.tar.gz ipxe-openslx.tar.xz ipxe-openslx.zip | |
Merge branch 'master' into openslxopenslx
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 ); |
