public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] sysboot: Add support for ubifs to the sysboot command
@ 2015-08-20 16:04 Hans de Goede
  2015-08-20 16:04 ` [U-Boot] [PATCH 2/3] ubifs: Add a ubifsexists command Hans de Goede
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Hans de Goede @ 2015-08-20 16:04 UTC (permalink / raw)
  To: u-boot

ubifs does not go though the generic block layer because mtd devices
are special, so the "any" filesystem option to sysboot does not work,
this adds support for a "ubifs" filesystem to the sysboot command which
makes it possible to boot from ubifs using an extlinux.conf file.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 common/cmd_pxe.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/common/cmd_pxe.c b/common/cmd_pxe.c
index 080b376..b4f2e3e 100644
--- a/common/cmd_pxe.c
+++ b/common/cmd_pxe.c
@@ -16,6 +16,10 @@
 #include <fs.h>
 #include <asm/io.h>
 
+#ifdef CONFIG_CMD_UBIFS
+#include "../fs/ubifs/ubifs.h"
+#endif
+
 #include "menu.h"
 #include "cli.h"
 
@@ -156,6 +160,17 @@ static int do_get_ext2(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
 	return -ENOENT;
 }
 
+static int do_get_ubifs(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
+{
+#ifdef CONFIG_CMD_UBIFS
+	u32 addr = simple_strtoul(file_addr, NULL, 16);
+
+	if (!ubifs_load((char *)file_path, addr, 0))
+		return 1;
+#endif
+	return -ENOENT;
+}
+
 static int do_get_fat(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
 {
 #ifdef CONFIG_CMD_FAT
@@ -1680,6 +1695,8 @@ static int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		do_getfile = do_get_ext2;
 	else if (strstr(argv[3], "fat"))
 		do_getfile = do_get_fat;
+	else if (strstr(argv[3], "ubifs"))
+		do_getfile = do_get_ubifs;
 	else if (strstr(argv[3], "any"))
 		do_getfile = do_get_any;
 	else {
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-08-22 18:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-20 16:04 [U-Boot] [PATCH 1/3] sysboot: Add support for ubifs to the sysboot command Hans de Goede
2015-08-20 16:04 ` [U-Boot] [PATCH 2/3] ubifs: Add a ubifsexists command Hans de Goede
2015-08-20 16:04 ` [U-Boot] [PATCH 3/3] distro_bootcmd: Add support for booting from ubifs Hans de Goede
2015-08-20 19:53 ` [U-Boot] [PATCH 1/3] sysboot: Add support for ubifs to the sysboot command Stephen Warren
2015-08-21  9:56 ` [U-Boot] [U-Boot, " Hans de Goede
2015-08-21 22:01   ` Stephen Warren
2015-08-22 18:04     ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox