[block] Allow SAN boot device to be identified by filesystem label

Add a "--label" option that can be used to specify a filesystem label,
to be matched against the FAT volume label.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2024-03-07 14:09:54 +00:00
parent 62b6d36335
commit 24a855f1fc
3 changed files with 81 additions and 1 deletions

View File

@@ -51,6 +51,8 @@ struct sanboot_options {
char *filename;
/** Required extra filename */
char *extra;
/** Volume label */
char *label;
/** UUID */
struct uuid_option uuid;
};
@@ -58,7 +60,7 @@ struct sanboot_options {
/** "sanboot" option list */
static union {
/* "sanboot" takes all options */
struct option_descriptor sanboot[6];
struct option_descriptor sanboot[7];
/* "sanhook" takes only --drive and --no-describe */
struct option_descriptor sanhook[2];
/* "sanunhook" takes only --drive */
@@ -75,6 +77,8 @@ static union {
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 ),
},
@@ -135,6 +139,7 @@ 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 */