summaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-09-17 18:46:58 -0400
committerTom Rini <trini@konsulko.com>2015-10-24 13:50:32 -0400
commit251cee0db23f1e2294ce28a102afde6a20e5673c (patch)
tree38925876c528afc1538b35cb0bc5d7876255dfbe /disk
parent29cc5bcadfc36957574fd0d17238a23419cac7da (diff)
ubifs: Add generic fs support
Add generic fs support, so that commands like ls, load and test -e can be used on ubifs. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'disk')
-rw-r--r--disk/part.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/disk/part.c b/disk/part.c
index 8c65cdb60dd..e57a252d948 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,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
@@ -532,6 +537,28 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str,
}
#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) ||
!strcmp(dev_part_str, "-"))