X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=disk%2Fpart.c;h=909712e5011932dfe9acfff008ca58e145ade1f2;hb=69a00875e3db178cfcb19ea8ab97c8927a11e593;hp=cfd77b0ff567cbacd4f5a3e6223e2edeb28fbd69;hpb=214b3f311f0c1ac4c8f68e45133fc3547c76d8d1;p=u-boot diff --git a/disk/part.c b/disk/part.c index cfd77b0ff5..909712e501 100644 --- a/disk/part.c +++ b/disk/part.c @@ -10,6 +10,7 @@ #include #include #include +#include #undef PART_DEBUG @@ -57,7 +58,7 @@ static const struct block_drvr block_drvr[] = { DECLARE_GLOBAL_DATA_PTR; #ifdef HAVE_BLOCK_DEVICE -block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart) +static block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart) { const struct block_drvr *drvr = block_drvr; block_dev_desc_t* (*reloc_get_dev)(int dev); @@ -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,11 @@ 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 * host's own filesystem. @@ -526,9 +535,35 @@ 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 /* If no dev_part_str, use bootdevice environment variable */ if (!dev_part_str || !strlen(dev_part_str) || @@ -610,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;