summaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-12-26 09:53:35 +0000
committerTom Rini <trini@ti.com>2013-03-04 14:19:56 -0500
commit92ccc96bf3cd6c6a3a9a56e03d5ceb4874735d22 (patch)
tree7dda0f2132ce0b85cb574ca33ac85a9ac5727fd7 /disk
parent62584db191013f13133be0f6702d0c935a7c85a6 (diff)
downloadu-boot-92ccc96bf3cd6c6a3a9a56e03d5ceb4874735d22.tar.gz
u-boot-92ccc96bf3cd6c6a3a9a56e03d5ceb4874735d22.tar.bz2
u-boot-92ccc96bf3cd6c6a3a9a56e03d5ceb4874735d22.zip
sandbox: Add host filesystem
This allows reading of files from the host filesystem in sandbox. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'disk')
-rw-r--r--disk/part.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/disk/part.c b/disk/part.c
index 7bdc90eff7..58a45637aa 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -472,6 +472,23 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str,
int part;
disk_partition_t tmpinfo;
+ /*
+ * For now, we have a special case for sandbox, since there is no
+ * real block device support.
+ */
+ if (0 == strcmp(ifname, "host")) {
+ *dev_desc = NULL;
+ info->start = info->size = info->blksz = 0;
+ info->bootable = 0;
+ strcpy((char *)info->type, BOOT_PART_TYPE);
+ strcpy((char *)info->name, "Sandbox host");
+#ifdef CONFIG_PARTITION_UUIDS
+ info->uuid[0] = 0;
+#endif
+
+ return 0;
+ }
+
/* If no dev_part_str, use bootdevice environment variable */
if (!dev_part_str || !strlen(dev_part_str) ||
!strcmp(dev_part_str, "-"))