1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

gpt: add optional parameter type in gpt command

code under flag CONFIG_PARTITION_TYPE_GUID
add parameter "type" to select partition type guid

example of use with gpt command :

  partitions = uuid_disk=${uuid_gpt_disk}; \
      name=boot,size=0x6bc00,uuid=${uuid_gpt_boot}; \
      name=root,size=0x7538ba00,uuid=${uuid_gpt_root}, \
         type=0fc63daf-8483-4772-8e79-3d69d8477de4;

  gpt write mmc 0 $partitions

Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com>
This commit is contained in:
Patrick Delaunay
2015-10-27 11:00:27 +01:00
committed by Tom Rini
parent b38c108a98
commit 7561b258a1
5 changed files with 67 additions and 0 deletions

View File

@@ -218,6 +218,23 @@ static int set_gpt_info(block_dev_desc_t *dev_desc,
strcpy((char *)parts[i].uuid, p);
free(val);
}
#ifdef CONFIG_PARTITION_TYPE_GUID
/* guid */
val = extract_val(tok, "type");
if (val) {
/* 'type' is optional */
if (extract_env(val, &p))
p = val;
if (strlen(p) >= sizeof(parts[i].type_guid)) {
printf("Wrong type guid format for partition %d\n",
i);
errno = -4;
goto err;
}
strcpy((char *)parts[i].type_guid, p);
free(val);
}
#endif
/* name */
val = extract_val(tok, "name");
if (!val) { /* name is mandatory */