summaryrefslogtreecommitdiffstats
path: root/src/hci/commands/sanboot_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hci/commands/sanboot_cmd.c')
-rw-r--r--src/hci/commands/sanboot_cmd.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/hci/commands/sanboot_cmd.c b/src/hci/commands/sanboot_cmd.c
index 3907276a..6ab9e884 100644
--- a/src/hci/commands/sanboot_cmd.c
+++ b/src/hci/commands/sanboot_cmd.c
@@ -47,14 +47,20 @@ struct sanboot_options {
int no_describe;
/** Keep SAN device */
int keep;
- /** Filename */
+ /** Boot filename */
char *filename;
+ /** Required extra filename */
+ char *extra;
+ /** Volume label */
+ char *label;
+ /** UUID */
+ struct uuid_option uuid;
};
/** "sanboot" option list */
static union {
- /* "sanboot" takes all four options */
- struct option_descriptor sanboot[4];
+ /* "sanboot" takes all options */
+ struct option_descriptor sanboot[7];
/* "sanhook" takes only --drive and --no-describe */
struct option_descriptor sanhook[2];
/* "sanunhook" takes only --drive */
@@ -69,10 +75,15 @@ static union {
struct sanboot_options, keep, parse_flag ),
OPTION_DESC ( "filename", 'f', required_argument,
struct sanboot_options, filename, parse_string ),
+ OPTION_DESC ( "extra", 'e', required_argument,
+ struct sanboot_options, extra, parse_string ),
+ OPTION_DESC ( "label", 'l', required_argument,
+ struct sanboot_options, label, parse_string ),
+ OPTION_DESC ( "uuid", 'u', required_argument,
+ struct sanboot_options, uuid, parse_uuid ),
},
};
-
/** "sanhook" command descriptor */
static struct command_descriptor sanhook_cmd =
COMMAND_DESC ( struct sanboot_options, opts.sanhook, 1, MAX_ARGUMENTS,
@@ -100,6 +111,7 @@ static int sanboot_core_exec ( int argc, char **argv,
struct command_descriptor *cmd,
int default_flags, int no_root_path_flags ) {
struct sanboot_options opts;
+ struct san_boot_config config;
struct uri *uris[argc];
int count;
int flags;
@@ -124,6 +136,12 @@ static int sanboot_core_exec ( int argc, char **argv,
}
}
+ /* Construct configuration parameters */
+ config.filename = opts.filename;
+ config.extra = opts.extra;
+ config.label = opts.label;
+ config.uuid = opts.uuid.value;
+
/* Construct flags */
flags = default_flags;
if ( opts.no_describe )
@@ -134,7 +152,7 @@ static int sanboot_core_exec ( int argc, char **argv,
flags |= no_root_path_flags;
/* Boot from root path */
- if ( ( rc = uriboot ( NULL, uris, count, opts.drive, opts.filename,
+ if ( ( rc = uriboot ( NULL, uris, count, opts.drive, &config,
flags ) ) != 0 )
goto err_uriboot;