mirror of https://github.com/ipxe/ipxe.git
Add "config" command to access config UI
parent
666b309c0c
commit
8f9336e0c1
|
@ -116,6 +116,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define NVO_CMD /* Non-volatile option storage commands */
|
#define NVO_CMD /* Non-volatile option storage commands */
|
||||||
|
#define CONFIG_CMD /* Option configuration console */
|
||||||
|
|
||||||
/* @END general.h */
|
/* @END general.h */
|
||||||
|
|
||||||
|
|
|
@ -146,6 +146,9 @@ REQUIRE_OBJECT ( pxe );
|
||||||
#ifdef NVO_CMD
|
#ifdef NVO_CMD
|
||||||
REQUIRE_OBJECT ( nvo_cmd );
|
REQUIRE_OBJECT ( nvo_cmd );
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CONFIG_CMD
|
||||||
|
REQUIRE_OBJECT ( config_cmd );
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Drag in miscellaneous objects
|
* Drag in miscellaneous objects
|
||||||
|
|
|
@ -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,
|
||||||
|
};
|
|
@ -0,0 +1,14 @@
|
||||||
|
#ifndef _GPXE_SETTINGS_UI_H
|
||||||
|
#define _GPXE_SETTINGS_UI_H
|
||||||
|
|
||||||
|
/** @file
|
||||||
|
*
|
||||||
|
* Option configuration console
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct config_context;
|
||||||
|
|
||||||
|
extern void settings_ui ( struct config_context *context );
|
||||||
|
|
||||||
|
#endif /* _GPXE_SETTINGS_UI_H */
|
Loading…
Reference in New Issue