mirror of
https://github.com/ipxe/ipxe
synced 2025-12-21 04:20:17 +03:00
Add "config" command to access config UI
This commit is contained in:
35
src/hci/commands/config_cmd.c
Normal file
35
src/hci/commands/config_cmd.c
Normal file
@@ -0,0 +1,35 @@
|
||||
#include <string.h>
|
||||
#include <vsprintf.h>
|
||||
#include <gpxe/command.h>
|
||||
#include <gpxe/settings.h>
|
||||
#include <gpxe/settings_ui.h>
|
||||
|
||||
|
||||
#include <gpxe/nvo.h>
|
||||
extern struct nvo_block *ugly_nvo_hack;
|
||||
|
||||
|
||||
static int config_exec ( int argc, char **argv ) {
|
||||
struct config_context dummy_context;
|
||||
|
||||
if ( argc != 1 ) {
|
||||
printf ( "Usage: %s\n"
|
||||
"Opens the option configuration console\n", argv[0] );
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( ! ugly_nvo_hack ) {
|
||||
printf ( "No non-volatile option storage available\n" );
|
||||
return 1;
|
||||
}
|
||||
|
||||
dummy_context.options = ugly_nvo_hack->options;
|
||||
settings_ui ( &dummy_context );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct command config_command __command = {
|
||||
.name = "config",
|
||||
.exec = config_exec,
|
||||
};
|
||||
Reference in New Issue
Block a user