summaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2017-01-27 10:00:42 (GMT)
committerTom Rini <trini@konsulko.com>2017-01-28 13:48:03 (GMT)
commitb331cd6204ffdc568cd6c06bd18e72aa9bc61f22 (patch)
tree3f50e6283579b3a6a063befd7bc5698ecdfc6954 /disk
parent4ac96345b22cc8dcd299c6012cc5c80e44058bae (diff)
downloadu-boot-b331cd6204ffdc568cd6c06bd18e72aa9bc61f22.tar.xz
cmd, disk: convert CONFIG_PARTITION_UUIDS, CMD_PART and CMD_GPT
We convert CONFIG_PARTITION_UUIDS to Kconfig first. But in order to cleanly update all of the config files we must also update CMD_PART and CMD_GPT to also be in Kconfig in order to avoid complex logic elsewhere to update all of the config files. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay73@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'disk')
-rw-r--r--disk/Kconfig13
-rw-r--r--disk/part.c8
-rw-r--r--disk/part_dos.c6
-rw-r--r--disk/part_efi.c6
4 files changed, 23 insertions, 10 deletions
diff --git a/disk/Kconfig b/disk/Kconfig
index 03bf05d..268fb83 100644
--- a/disk/Kconfig
+++ b/disk/Kconfig
@@ -84,4 +84,17 @@ config SPL_EFI_PARTITION
depends on SPL && PARTITIONS
default y if EFI_PARTITION
+config PARTITION_UUIDS
+ bool "Enable support of UUID for partition"
+ depends on PARTITIONS
+ default y if DISTRO_DEFAULTS
+ default y if EFI_PARTITION
+ help
+ Activate the configuration of UUID for partition
+
+config SPL_PARTITION_UUIDS
+ bool "Enable support of UUID for partition in SPL"
+ depends on SPL && PARTITIONS
+ default y if SPL_EFI_PARTITION
+
endmenu
diff --git a/disk/part.c b/disk/part.c
index cd14e98..cd44702 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -299,7 +299,7 @@ int part_get_info(struct blk_desc *dev_desc, int part,
#ifdef HAVE_BLOCK_DEVICE
struct part_driver *drv;
-#ifdef CONFIG_PARTITION_UUIDS
+#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
/* The common case is no UUID support */
info->uuid[0] = 0;
#endif
@@ -416,7 +416,7 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
info->bootable = 0;
strcpy((char *)info->type, BOOT_PART_TYPE);
strcpy((char *)info->name, "Sandbox host");
-#ifdef CONFIG_PARTITION_UUIDS
+#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
info->uuid[0] = 0;
#endif
#ifdef CONFIG_PARTITION_TYPE_GUID
@@ -442,7 +442,7 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
memset(info, 0, sizeof(*info));
strcpy((char *)info->type, BOOT_PART_TYPE);
strcpy((char *)info->name, "UBI");
-#ifdef CONFIG_PARTITION_UUIDS
+#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
info->uuid[0] = 0;
#endif
return 0;
@@ -526,7 +526,7 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
info->bootable = 0;
strcpy((char *)info->type, BOOT_PART_TYPE);
strcpy((char *)info->name, "Whole Disk");
-#ifdef CONFIG_PARTITION_UUIDS
+#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
info->uuid[0] = 0;
#endif
#ifdef CONFIG_PARTITION_TYPE_GUID
diff --git a/disk/part_dos.c b/disk/part_dos.c
index ed78334..c77d881 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -189,7 +189,7 @@ static int part_get_info_extended(struct blk_desc *dev_desc,
return -1;
}
-#ifdef CONFIG_PARTITION_UUIDS
+#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
if (!ext_part_sector)
disksig = le32_to_int(&buffer[DOS_PART_DISKSIG_OFFSET]);
#endif
@@ -214,7 +214,7 @@ static int part_get_info_extended(struct blk_desc *dev_desc,
/* sprintf(info->type, "%d, pt->sys_ind); */
strcpy((char *)info->type, "U-Boot");
info->bootable = is_bootable(pt);
-#ifdef CONFIG_PARTITION_UUIDS
+#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
sprintf(info->uuid, "%08x-%02x", disksig, part_num);
#endif
return 0;
@@ -249,7 +249,7 @@ static int part_get_info_extended(struct blk_desc *dev_desc,
info->blksz = DOS_PART_DEFAULT_SECTOR;
info->bootable = 0;
strcpy((char *)info->type, "U-Boot");
-#ifdef CONFIG_PARTITION_UUIDS
+#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
info->uuid[0] = 0;
#endif
return 0;
diff --git a/disk/part_efi.c b/disk/part_efi.c
index f1b7116..b5928e5 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -279,7 +279,7 @@ int part_get_info_efi(struct blk_desc *dev_desc, int part,
print_efiname(&gpt_pte[part - 1]));
strcpy((char *)info->type, "U-Boot");
info->bootable = is_bootable(&gpt_pte[part - 1]);
-#ifdef CONFIG_PARTITION_UUIDS
+#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
uuid_bin_to_str(gpt_pte[part - 1].unique_partition_guid.b, info->uuid,
UUID_STR_FORMAT_GUID);
#endif
@@ -397,7 +397,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
le64_to_cpu(gpt_h->last_usable_lba);
int i, k;
size_t efiname_len, dosname_len;
-#ifdef CONFIG_PARTITION_UUIDS
+#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
char *str_uuid;
unsigned char *bin_uuid;
#endif
@@ -452,7 +452,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
&PARTITION_BASIC_DATA_GUID, 16);
#endif
-#ifdef CONFIG_PARTITION_UUIDS
+#if CONFIG_IS_ENABLED(PARTITION_UUIDS)
str_uuid = partitions[i].uuid;
bin_uuid = gpt_e[i].unique_partition_guid.b;