[Buildroot] [PATCH v9 19/22] board/ti/am62x-sk: move post-{build, image}.sh to board/ti/common/am6xx

Dario Binacchi dario.binacchi at amarulasolutions.com
Mon Mar 4 15:32:50 UTC 2024


The patch makes it clear that the moved scripts can be used by the
am6{2,4}x platforms.

Signed-off-by: Dario Binacchi <dario.binacchi at amarulasolutions.com>

---

Added in v8

 board/ti/am62x-sk/post-image.sh                   |  5 -----
 board/ti/{am62x-sk => common/am6xx}/post-build.sh |  0
 board/ti/common/am6xx/post-image.sh               | 11 +++++++++++
 configs/ti_am62x_sk_defconfig                     |  4 ++--
 4 files changed, 13 insertions(+), 7 deletions(-)
 delete mode 100755 board/ti/am62x-sk/post-image.sh
 rename board/ti/{am62x-sk => common/am6xx}/post-build.sh (100%)
 create mode 100755 board/ti/common/am6xx/post-image.sh

diff --git a/board/ti/am62x-sk/post-image.sh b/board/ti/am62x-sk/post-image.sh
deleted file mode 100755
index 34f732c091ad..000000000000
--- a/board/ti/am62x-sk/post-image.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh -x
-
-BOARD_DIR="$(dirname "$0")"
-
-support/scripts/genimage.sh -c "${BOARD_DIR}/genimage.cfg"
diff --git a/board/ti/am62x-sk/post-build.sh b/board/ti/common/am6xx/post-build.sh
similarity index 100%
rename from board/ti/am62x-sk/post-build.sh
rename to board/ti/common/am6xx/post-build.sh
diff --git a/board/ti/common/am6xx/post-image.sh b/board/ti/common/am6xx/post-image.sh
new file mode 100755
index 000000000000..917ca238aa78
--- /dev/null
+++ b/board/ti/common/am6xx/post-image.sh
@@ -0,0 +1,11 @@
+#!/bin/sh -x
+
+board_dir() {
+    if grep -Eq "^BR2_DEFCONFIG=.*/ti_am64x_sk_defconfig\"$" "${BR2_CONFIG}"; then
+        echo "am64x-sk"
+    else
+        echo "am62x-sk"
+    fi
+}
+
+support/scripts/genimage.sh -c "board/ti/$(board_dir)/genimage.cfg"
diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
index bd294bb712ee..310ba6fb6453 100644
--- a/configs/ti_am62x_sk_defconfig
+++ b/configs/ti_am62x_sk_defconfig
@@ -1,7 +1,7 @@
 BR2_aarch64=y
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
-BR2_ROOTFS_POST_BUILD_SCRIPT="board/ti/am62x-sk/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/am62x-sk/post-image.sh"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/ti/common/am6xx/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/ti/common/am6xx/post-image.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="-c ttyS2,115200n8 -d k3-am625-sk.dtb -l am62x-sk-buildroot -r /dev/mmcblk1p2 -x earlycon=ns16550a,mmio32,0x02800000"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
-- 
2.43.0




More information about the buildroot mailing list