From 8caac27d69f54eac96cbb14687e9d54797de2354 Mon Sep 17 00:00:00 2001 From: Neal Frager Date: Sun, 15 Mar 2026 15:43:42 +0000 Subject: [PATCH] board/versal/post-image.sh: add custom hardware support 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 Reviewed-by: Luca Ceresoli Signed-off-by: Arnout Vandecappelle --- 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")"