public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Derald D. Woods <woods.technical@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] distro bootcmd: Allow board defined UBI partition and volume names
Date: Sat, 20 Jan 2018 21:16:13 -0600	[thread overview]
Message-ID: <20180121031614.29091-2-woods.technical@gmail.com> (raw)
In-Reply-To: <20180121031614.29091-1-woods.technical@gmail.com>

This commit allows overriding the default assumption that the boot UBI
MTD partition is named 'UBI' and the UBI volume is 'boot'. A board
desiring to use a legacy or alternative NAND layout can now define the
following two extra environment variables:

	bootubipart=<some_ubi_partition_name>
	bootubivol=<some_ubi_volume_name>

EXAMPLE:

[include/configs/some_board.h]
---8<-------------------------------------------------------------------
[...]
	#include <config_distro_defaults.h>

	#define MEM_LAYOUT_ENV_SETTINGS \
		DEFAULT_LINUX_BOOT_ENV

	#define BOOT_TARGET_DEVICES(func) \
		func(UBIFS, ubifs, 0)

	#include <config_distro_bootcmd.h>
[...]
	#define CONFIG_EXTRA_ENV_SETTINGS \
		MEM_LAYOUT_ENV_SETTINGS \
		"bootubivol=rootfs\0" \
		"bootubipart=rootfs\0" \
		BOOTENV
[...]
---8<-------------------------------------------------------------------

Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
---
 include/config_distro_bootcmd.h | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 5c469a23fa..f567cebd38 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -71,10 +71,15 @@
 #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; "                         \
+		"env exists bootubipart || " \
+			"env set bootubipart UBI; " \
+		"env exists bootubivol || " \
+			"env set bootubivol boot; " \
+		"if ubi part ${bootubipart} && " \
+			"ubifsmount ubi${devnum}:${bootubivol}; " \
+		"then " \
+			"setenv devtype ubi; " \
+			"run scan_dev_for_boot; " \
 		"fi\0"
 #define BOOTENV_DEV_UBIFS	BOOTENV_DEV_BLKDEV
 #define BOOTENV_DEV_NAME_UBIFS	BOOTENV_DEV_NAME_BLKDEV
@@ -125,7 +130,7 @@
 			"${kernel_addr_r} efi/boot/"BOOTEFI_NAME"; "      \
 		"if fdt addr ${fdt_addr_r}; then "                        \
 			"bootefi ${kernel_addr_r} ${fdt_addr_r};"         \
-		"else "                                                    \
+		"else "                                                   \
 			"bootefi ${kernel_addr_r} ${fdtcontroladdr};"     \
 		"fi\0"                                                    \
 	\
-- 
2.16.0

  reply	other threads:[~2018-01-21  3:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-21  3:16 [U-Boot] [PATCH 0/2] ARM: omap3: evm: Fix distro bootcmd Derald D. Woods
2018-01-21  3:16 ` Derald D. Woods [this message]
2018-01-28 18:53   ` [U-Boot] [U-Boot, 1/2] distro bootcmd: Allow board defined UBI partition and volume names Tom Rini
2018-01-21  3:16 ` [U-Boot] [PATCH 2/2] ARM: omap3: evm: Fix distro bootcmd UBIFS and MMC support Derald D. Woods
2018-01-28 18:53   ` [U-Boot] [U-Boot, " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180121031614.29091-2-woods.technical@gmail.com \
    --to=woods.technical@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox