#include <ide.h>
#include <malloc.h>
#include <part.h>
+#include <ubifs_uboot.h>
#undef PART_DEBUG
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
}
#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, "-"))
#include <fat.h>
#include <fs.h>
#include <sandboxfs.h>
+#include <ubifs_uboot.h>
#include <asm/io.h>
#include <div64.h>
#include <linux/math64.h>
.write = fs_write_sandbox,
.uuid = fs_uuid_unsupported,
},
+#endif
+#ifdef CONFIG_CMD_UBIFS
+ {
+ .fstype = FS_TYPE_UBIFS,
+ .name = "ubifs",
+ .null_dev_desc_ok = true,
+ .probe = ubifs_set_blk_dev,
+ .close = ubifs_close,
+ .ls = ubifs_ls,
+ .exists = ubifs_exists,
+ .size = ubifs_size,
+ .read = ubifs_read,
+ .write = fs_write_unsupported,
+ .uuid = fs_uuid_unsupported,
+ },
#endif
{
.fstype = FS_TYPE_ANY,