diff options
author | Stefano Babic <sbabic@denx.de> | 2015-10-30 14:52:51 +0100 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2015-10-30 14:52:51 +0100 |
commit | e573bdb324c78fac56655a493bea843842c9d9f8 (patch) | |
tree | 3933d354a6be71cbe66d583fec3f5b2479e596ee /disk | |
parent | a69fdc7787bfa2f27eed74c2ee58c28ce932d502 (diff) | |
parent | 0eb4cf9c14315e1976a116de75da6f420ac0e8dd (diff) |
Merge branch 'master' of git://git.denx.de/u-boot
Diffstat (limited to 'disk')
-rw-r--r-- | disk/part.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/disk/part.c b/disk/part.c index 43485c9148..e57a252d94 100644 --- a/disk/part.c +++ b/disk/part.c @@ -10,6 +10,7 @@ #include <ide.h> #include <malloc.h> #include <part.h> +#include <ubifs_uboot.h> #undef PART_DEBUG @@ -511,6 +512,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. @@ -529,6 +535,29 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str, 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) || |