Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gary Bisson <gary.bisson@boundarydevices.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/5] board/boundarydevices: update post-build.sh for i.MX8MQ platforms
Date: Thu, 19 Jul 2018 09:32:50 +0200	[thread overview]
Message-ID: <20180719073253.22433-3-gary.bisson@boundarydevices.com> (raw)
In-Reply-To: <20180719073253.22433-1-gary.bisson@boundarydevices.com>

- Making sure to use proper ARCH for mkimage command
- Remove obsolete 6x_bootscript/6x_upgrade references
- Copy bootloader as u-boot.<defconfig_name>

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
---
 board/boundarydevices/common/post-build.sh | 28 ++++++++++++----------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/board/boundarydevices/common/post-build.sh b/board/boundarydevices/common/post-build.sh
index b8abb26540..161ec0643f 100755
--- a/board/boundarydevices/common/post-build.sh
+++ b/board/boundarydevices/common/post-build.sh
@@ -6,20 +6,24 @@
 #
 
 BOARD_DIR="$(dirname $0)"
+UBOOT_DEFCONFIG="$(grep BR2_TARGET_UBOOT_BOARD_DEFCONFIG ${BR2_CONFIG} | sed 's/.*\"\(.*\)\"/\1/')"
+
+if grep -Eq "^BR2_aarch64=y$" ${BR2_CONFIG}; then
+	MKIMAGE_ARCH=arm64
+	UBOOT_BINARY=imx8-boot-sd.bin
+else
+	MKIMAGE_ARCH=arm
+	UBOOT_BINARY=u-boot.imx
+fi
 
 # bd u-boot looks for standard bootscript
-install -m 0644 -D $BINARIES_DIR/boot.scr $TARGET_DIR/boot/
-# legacy 6x_bootscript script
-$HOST_DIR/bin/mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
--n "boot script" -d $BOARD_DIR/6x_bootscript.txt $TARGET_DIR/6x_bootscript
+$HOST_DIR/bin/mkimage -A $MKIMAGE_ARCH -O linux -T script -C none -a 0 -e 0 \
+    -n "boot script" -d $BOARD_DIR/boot.cmd $TARGET_DIR/boot/boot.scr
 
 # u-boot / update script for bd upgradeu command
-if [ -e $BINARIES_DIR/u-boot.imx ];
-then
-    install -D -m 0644 $BINARIES_DIR/u-boot.imx $TARGET_DIR/u-boot.imx
-    $HOST_DIR/bin/mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
-    -n "upgrade script" -d $BOARD_DIR/upgrade.cmd $TARGET_DIR/upgrade.scr
-    # legacy 6x_upgrade script
-    $HOST_DIR/bin/mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
-    -n "upgrade script" -d $BOARD_DIR/6x_upgrade.txt $TARGET_DIR/6x_upgrade
+if [ -e $BINARIES_DIR/$UBOOT_BINARY ]; then
+    install -D -m 0644 $BINARIES_DIR/$UBOOT_BINARY \
+        $TARGET_DIR/u-boot.$UBOOT_DEFCONFIG
+    $HOST_DIR/bin/mkimage -A $MKIMAGE_ARCH -O linux -T script -C none -a 0 -e 0 \
+        -n "upgrade script" -d $BOARD_DIR/upgrade.cmd $TARGET_DIR/upgrade.scr
 fi
-- 
2.18.0

  parent reply	other threads:[~2018-07-19  7:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-19  7:32 [Buildroot] [PATCH 0/5] Add Boundary Devices Nitrogen8M support Gary Bisson
2018-07-19  7:32 ` [Buildroot] [PATCH 1/5] board/freescale/common/imx: make imx8-bootloader-prepare more generic Gary Bisson
2018-07-19  7:45   ` Thomas Petazzoni
2018-07-19  8:00     ` Gary Bisson
2018-07-19  8:07       ` Thomas Petazzoni
2018-07-19  7:32 ` Gary Bisson [this message]
2018-07-19  7:58   ` [Buildroot] [PATCH 2/5] board/boundarydevices: update post-build.sh for i.MX8MQ platforms Thomas Petazzoni
2018-07-19  8:03     ` Gary Bisson
2018-07-19  8:08       ` Thomas Petazzoni
2018-07-19  8:15         ` Gary Bisson
2018-07-19  7:32 ` [Buildroot] [PATCH 3/5] board/boundarydevices: remove obsolete u-boot scripts Gary Bisson
2018-07-19  7:59   ` Thomas Petazzoni
2018-07-19  7:32 ` [Buildroot] [PATCH 4/5] board/boundarydevices: add i.MX8MQ support to " Gary Bisson
2018-07-19  7:32 ` [Buildroot] [PATCH 5/5] configs/nitrogen8m: Add new defconfig Gary Bisson
2018-07-19  8:10   ` Thomas Petazzoni
2018-07-19  8:23     ` Gary Bisson
2018-07-19  8:32       ` Thomas Petazzoni
2018-07-26  8:20       ` Arnout Vandecappelle
2018-07-26  8:51         ` Gary Bisson
2018-07-26  8:54           ` Arnout Vandecappelle

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=20180719073253.22433-3-gary.bisson@boundarydevices.com \
    --to=gary.bisson@boundarydevices.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