[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>
This commit is contained in:
Michael Brown
2024-03-06 08:55:55 +00:00
parent c4471e3408
commit cea22d76e4
5 changed files with 41 additions and 7 deletions

View File

@@ -129,20 +129,21 @@ int parse_timeout ( char *text, unsigned long *value ) {
* Parse UUID
*
* @v text Text
* @ret value UUID value
* @ret uuid UUID value
* @ret rc Return status code
*/
int parse_uuid ( char *text, union uuid *value ) {
int parse_uuid ( char *text, struct uuid_option *uuid ) {
int rc;
/* Sanity check */
assert ( text != NULL );
/* Parse UUID */
if ( ( rc = uuid_aton ( text, value ) ) != 0 ) {
if ( ( rc = uuid_aton ( text, &uuid->buf ) ) != 0 ) {
printf ( "\"%s\": invalid UUID\n", text );
return rc;
}
uuid->value = &uuid->buf;
return 0;
}