diff mbox

[U-Boot,v2,5/5] distro_bootcmd: Add support for booting from ubifs

Message ID 1442530019-2692-5-git-send-email-hdegoede@redhat.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Hans de Goede Sept. 17, 2015, 10:46 p.m. UTC
From: Roy Spliet <r.spliet@ultimaker.com>

Under the assumptions of having a UBI volume called boot, containing
a ubifs filesystem.

Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
---
Changes in v2:
-Added Stephen's ack
---
 include/config_distro_bootcmd.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Comments

Tom Rini Oct. 24, 2015, 9:15 p.m. UTC | #1
On Thu, Sep 17, 2015 at 06:46:59PM -0400, Hans de Goede wrote:

> From: Roy Spliet <r.spliet@ultimaker.com>
> 
> Under the assumptions of having a UBI volume called boot, containing
> a ubifs filesystem.
> 
> Signed-off-by: Roy Spliet <rspliet@eclipso.eu>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> Acked-by: Stephen Warren <swarren@nvidia.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 3a360ca4..2b36d80 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -72,6 +72,24 @@ 
 	BOOT_TARGET_DEVICES_references_MMC_without_CONFIG_CMD_MMC
 #endif
 
+#ifdef CONFIG_CMD_UBIFS
+#define BOOTENV_SHARED_UBIFS \
+	"ubifs_boot=" \
+		"if ubi part UBI && ubifsmount ubi${devnum}:boot; then "  \
+			"setenv devtype ubi; "                            \
+			"setenv bootpart 0; "                             \
+			"run scan_dev_for_boot; "                         \
+		"fi\0"
+#define BOOTENV_DEV_UBIFS	BOOTENV_DEV_BLKDEV
+#define BOOTENV_DEV_NAME_UBIFS	BOOTENV_DEV_NAME_BLKDEV
+#else
+#define BOOTENV_SHARED_UBIFS
+#define BOOTENV_DEV_UBIFS \
+	BOOT_TARGET_DEVICES_references_UBIFS_without_CONFIG_CMD_UBIFS
+#define BOOTENV_DEV_NAME_UBIFS \
+	BOOT_TARGET_DEVICES_references_UBIFS_without_CONFIG_CMD_UBIFS
+#endif
+
 #ifdef CONFIG_CMD_SATA
 #define BOOTENV_SHARED_SATA	BOOTENV_SHARED_BLKDEV(sata)
 #define BOOTENV_DEV_SATA	BOOTENV_DEV_BLKDEV
@@ -185,6 +203,7 @@ 
 	BOOTENV_SHARED_SATA \
 	BOOTENV_SHARED_SCSI \
 	BOOTENV_SHARED_IDE \
+	BOOTENV_SHARED_UBIFS \
 	"boot_prefixes=/ /boot/\0" \
 	"boot_scripts=boot.scr.uimg boot.scr\0" \
 	"boot_script_dhcp=boot.scr.uimg\0" \