Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 1/2] imx/post-image: Allow flashing u-boot-dtb.imx in the SD card
Date: Sun,  8 Jul 2018 18:16:18 -0300	[thread overview]
Message-ID: <1531084579-7949-1-git-send-email-festevam@gmail.com> (raw)

Add support for flashing the u-boot-dtb.imx binary in the SD card
when a target selects BR2_TARGET_UBOOT_FORMAT_DTB_IMX.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
Changes since v1:
- Use a UBOOTBIN variable to decide the U-Boot binary name instead
of creating a new genimage.cfg variant. (Thanks to Arnout!)

 board/freescale/common/imx/genimage.cfg.template |  2 +-
 board/freescale/common/imx/post-image.sh         | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/board/freescale/common/imx/genimage.cfg.template b/board/freescale/common/imx/genimage.cfg.template
index acce058..2a7036a 100644
--- a/board/freescale/common/imx/genimage.cfg.template
+++ b/board/freescale/common/imx/genimage.cfg.template
@@ -22,7 +22,7 @@ image sdcard.img {
 
   partition u-boot {
     in-partition-table = "no"
-    image = "u-boot.imx"
+    image = "%UBOOTBIN%"
     offset = 1024
   }
 
diff --git a/board/freescale/common/imx/post-image.sh b/board/freescale/common/imx/post-image.sh
index 264c8a4..6590bed 100755
--- a/board/freescale/common/imx/post-image.sh
+++ b/board/freescale/common/imx/post-image.sh
@@ -41,13 +41,24 @@ genimage_type()
 	fi
 }
 
+uboot_image()
+{
+	if grep -Eq "^BR2_TARGET_UBOOT_FORMAT_DTB_IMX=y$" ${BR2_CONFIG}; then
+		echo "u-boot-dtb.imx"
+	elif grep -Eq "^BR2_TARGET_UBOOT_FORMAT_IMX=y$" ${BR2_CONFIG}; then
+		echo "u-boot.imx"
+	fi
+}
+
 main()
 {
 	local FILES="$(dtb_list) $(linux_image)"
+	local UBOOTBIN="$(uboot_image)"
 	local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)"
 	local GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
 
 	sed -e "s/%FILES%/${FILES}/" \
+		-e "s/%UBOOTBIN%/${UBOOTBIN}/" \
 		board/freescale/common/imx/$(genimage_type) > ${GENIMAGE_CFG}
 
 	rm -rf "${GENIMAGE_TMP}"
-- 
2.7.4

             reply	other threads:[~2018-07-08 21:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-08 21:16 Fabio Estevam [this message]
2018-07-08 21:16 ` [Buildroot] [PATCH v2 2/2] configs/imx7d-sdb: Add new defconfig Fabio Estevam
2018-07-18 10:01   ` Thomas Petazzoni
2018-07-18 12:21     ` Fabio Estevam
2018-07-18 12:51       ` Thomas Petazzoni
2018-07-18 13:03         ` Fabio Estevam
2018-07-18 13:12           ` Thomas Petazzoni
2018-07-18 13:18             ` Fabio Estevam
2018-07-14 16:31 ` [Buildroot] [PATCH v2 1/2] imx/post-image: Allow flashing u-boot-dtb.imx in the SD card Fabio Estevam
2018-07-18  9:59 ` Thomas Petazzoni

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=1531084579-7949-1-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=buildroot@busybox.net \
    /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