public inbox for buildroot@busybox.net
 help / color / mirror / Atom feed
From: Neal Frager via buildroot <buildroot@buildroot.org>
To: <buildroot@buildroot.org>
Cc: ibai.erkiaga-elorza@amd.com, luca.ceresoli@bootlin.com,
	yann.morin@orange.com, brandon.maier@collins.com,
	fiona.klute@gmx.de, ju.o@free.fr,
	Neal Frager <neal.frager@amd.com>,
	thomas.petazzoni@bootlin.com, romain.naour@smile.fr,
	michal.simek@amd.com, romain.naour@gmail.com
Subject: [Buildroot] [PATCH v5 2/3] board/versal/post-image.sh: add custom hardware support
Date: Sun, 15 Mar 2026 15:43:42 +0000	[thread overview]
Message-ID: <20260315154343.3144013-2-neal.frager@amd.com> (raw)
In-Reply-To: <20260315154343.3144013-1-neal.frager@amd.com>

By switching to the LINUX_DTBS variable, the post-image.sh script can now
work regardless of whether a user is using BR2_LINUX_KERNEL_INTREE_DTS_NAME
or the BR2_LINUX_KERNEL_CUSTOM_DTS_DIR for custom hardware. This simplifies
the transition users will make when migrating from a versal evaluation board
to a versal custom platform.

To keep the example post-image script as simple as possible, it assumes that
the first DTB in the LINUX_DTBS list is the one for creating the system.dtb
filename that u-boot will use for booting. Users are free to implement their
own post-image scripts for use cases with multiple DTBs.

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
V1->V2:
- removed unnecessary $BINARIES_DIR from symlink source
V2->V3:
- ignore anything after the first space char of LINUX_DTBS
V3->V4:
- use make print-vars to get LINUX_DTBS variable
V4->V5:
- fixed shellcheck issue
---
 board/versal/post-image.sh | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/board/versal/post-image.sh b/board/versal/post-image.sh
index 3242e4384a..4a810ff15b 100755
--- a/board/versal/post-image.sh
+++ b/board/versal/post-image.sh
@@ -2,13 +2,9 @@
 
 # By default U-Boot loads DTB from a file named "system.dtb", so
 # let's use a symlink with that name that points to the *first*
-# devicetree listed in the config.
-
-FIRST_DT=$(sed -nr \
-               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="(xilinx/)?([-_/[:alnum:]\\.]*).*"$|\2|p' \
-               "${BR2_CONFIG}")
-
-[ -z "${FIRST_DT}" ] || ln -fs "${FIRST_DT}.dtb" "${BINARIES_DIR}/system.dtb"
+# devicetree in the LINUX_DTBS list.
+LINUX_DTBS="$(make --no-print-directory VARS=LINUX_DTBS printvars)"
+ln -fs "$(basename "${LINUX_DTBS%% *}")" "${BINARIES_DIR}/system.dtb"
 
 BOARD_DIR="$(dirname "$0")"
 
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2026-03-15 15:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-15 15:43 [Buildroot] [PATCH v5 1/3] board/zynqmp/post-image.sh: add custom hardware support Neal Frager via buildroot
2026-03-15 15:43 ` Neal Frager via buildroot [this message]
2026-03-17  8:52   ` [Buildroot] [PATCH v5 2/3] board/versal/post-image.sh: " Luca Ceresoli via buildroot
2026-03-15 15:43 ` [Buildroot] [PATCH v5 3/3] board/versal2/post-image.sh: " Neal Frager via buildroot
2026-03-17  8:52   ` Luca Ceresoli via buildroot
2026-03-17  9:20     ` Frager, Neal via buildroot
2026-03-17  8:52 ` [Buildroot] [PATCH v5 1/3] board/zynqmp/post-image.sh: " Luca Ceresoli via buildroot

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=20260315154343.3144013-2-neal.frager@amd.com \
    --to=buildroot@buildroot.org \
    --cc=brandon.maier@collins.com \
    --cc=fiona.klute@gmx.de \
    --cc=ibai.erkiaga-elorza@amd.com \
    --cc=ju.o@free.fr \
    --cc=luca.ceresoli@bootlin.com \
    --cc=michal.simek@amd.com \
    --cc=neal.frager@amd.com \
    --cc=romain.naour@gmail.com \
    --cc=romain.naour@smile.fr \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yann.morin@orange.com \
    /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