diff options
author | Michael Brown <mcb30@ipxe.org> | 2024-03-06 08:55:55 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2024-03-06 16:11:29 +0000 |
commit | cea22d76e4cfdbd2d5a3a29bd541346710760457 (patch) | |
tree | 989f3ba4e8c9a604ecf060ce5aa5ce53dd526cca /src/hci/commands/sanboot_cmd.c | |
parent | c4471e3408d85c51a69991974985fe283d869eac (diff) | |
download | ipxe-cea22d76e4cfdbd2d5a3a29bd541346710760457.tar.gz |
[block] Allow SAN boot device to be identified by UUID
Add a "--uuid" option which may be used to specify a boot device UUID,
to be matched against the GPT partition GUID.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/hci/commands/sanboot_cmd.c')
-rw-r--r-- | src/hci/commands/sanboot_cmd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/hci/commands/sanboot_cmd.c b/src/hci/commands/sanboot_cmd.c index 9c7e9ab72..b3d9ccad3 100644 --- a/src/hci/commands/sanboot_cmd.c +++ b/src/hci/commands/sanboot_cmd.c @@ -49,12 +49,14 @@ struct sanboot_options { int keep; /** Filename */ char *filename; + /** 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[5]; /* "sanhook" takes only --drive and --no-describe */ struct option_descriptor sanhook[2]; /* "sanunhook" takes only --drive */ @@ -69,10 +71,11 @@ static union { struct sanboot_options, keep, parse_flag ), OPTION_DESC ( "filename", 'f', required_argument, struct sanboot_options, filename, 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, @@ -127,6 +130,7 @@ static int sanboot_core_exec ( int argc, char **argv, /* Construct configuration parameters */ config.filename = opts.filename; + config.uuid = opts.uuid.value; /* Construct flags */ flags = default_flags; |