Enabled GPT type GUIDs with -append_partition, -boot_image any iso_mbr_part_type=, and -as mkisofs -iso_mbr_part_type

This commit is contained in:
2019-02-18 13:19:32 +01:00
parent caf38e81ae
commit fc71cec8f7
17 changed files with 469 additions and 230 deletions

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2012 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2019 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -1334,3 +1334,36 @@ int Xorriso__exchange_prefix(char *source_prefix, char *target_prefix,
return(1);
}
/* @param text takes result, must provide at least 37 characters of storage
@param flag bit0= structured text format (else hex string)
*/
int Xorriso__format_guid(uint8_t guid[16], char *text, int flag)
{
int i;
if(flag & 1) {
/* Structured text */
text[0]= 0;
for(i= 3; i >= 0; i--)
sprintf(text + strlen(text), "%-2.2x", (unsigned int) guid[i]);
sprintf(text + strlen(text), "-");
for(i= 5; i >= 4; i--)
sprintf(text + strlen(text), "%-2.2x", (unsigned int) guid[i]);
sprintf(text + strlen(text), "-");
for(i= 7; i >= 6; i--)
sprintf(text + strlen(text), "%-2.2x", (unsigned int) guid[i]);
sprintf(text + strlen(text), "-");
for(i= 8; i <= 9; i++)
sprintf(text + strlen(text), "%-2.2x", (unsigned int) guid[i]);
sprintf(text + strlen(text), "-");
for(i= 10; i <= 15; i++)
sprintf(text + strlen(text), "%-2.2x", (unsigned int) guid[i]);
} else {
/* Plain hex string */
for(i= 0; i < 16; i++)
sprintf(text + i * 2, "%-2.2x", (unsigned int) guid[i]);
}
return(1);
}