X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=disk%2Fpart.c;h=909712e5011932dfe9acfff008ca58e145ade1f2;hb=69a00875e3db178cfcb19ea8ab97c8927a11e593;hp=8c65cdb60dda51181c305b8e6db70fae9e29d93b;hpb=afc1744ec87d26965fc9a311554e0d50962555bd;p=u-boot diff --git a/disk/part.c b/disk/part.c index 8c65cdb60d..909712e501 100644 --- a/disk/part.c +++ b/disk/part.c @@ -10,6 +10,7 @@ #include #include #include +#include #undef PART_DEBUG @@ -391,6 +392,9 @@ int get_partition_info(block_dev_desc_t *dev_desc, int part, /* The common case is no UUID support */ info->uuid[0] = 0; #endif +#ifdef CONFIG_PARTITION_TYPE_GUID + info->type_guid[0] = 0; +#endif switch (dev_desc->part_type) { #ifdef CONFIG_MAC_PARTITION @@ -511,6 +515,10 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str, int part; disk_partition_t tmpinfo; +#if defined CONFIG_SANDBOX && defined CONFIG_CMD_UBIFS +#error Only one of CONFIG_SANDBOX and CONFIG_CMD_UBIFS may be selected +#endif + #ifdef CONFIG_SANDBOX /* * Special-case a pseudo block device "hostfs", to allow access to the @@ -527,7 +535,32 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str, #ifdef CONFIG_PARTITION_UUIDS info->uuid[0] = 0; #endif +#ifdef CONFIG_PARTITION_TYPE_GUID + info->type_guid[0] = 0; +#endif + + return 0; + } +#endif + +#ifdef CONFIG_CMD_UBIFS + /* + * Special-case ubi, ubi goes through a mtd, rathen then through + * a regular block device. + */ + if (0 == strcmp(ifname, "ubi")) { + if (!ubifs_is_mounted()) { + printf("UBIFS not mounted, use ubifsmount to mount volume first!\n"); + return -1; + } + *dev_desc = NULL; + memset(info, 0, sizeof(*info)); + strcpy((char *)info->type, BOOT_PART_TYPE); + strcpy((char *)info->name, "UBI"); +#ifdef CONFIG_PARTITION_UUIDS + info->uuid[0] = 0; +#endif return 0; } #endif @@ -612,6 +645,9 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str, #ifdef CONFIG_PARTITION_UUIDS info->uuid[0] = 0; #endif +#ifdef CONFIG_PARTITION_TYPE_GUID + info->type_guid[0] = 0; +#endif ret = 0; goto cleanup;