david/ipxe
Archived
1
0
This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
ipxe/src/hci/commands/config_cmd.c
2006-12-20 11:42:48 +00:00

41 lines
800 B
C

#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;
int rc;
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;
if ( ( rc = settings_ui ( &dummy_context ) ) != 0 ) {
printf ( "Could not save settings: %s\n",
strerror ( rc ) );
return 1;
}
return 0;
}
struct command config_command __command = {
.name = "config",
.exec = config_exec,
};