From dbf0fd2514a7c532d71e1688fd74b0c513b92815 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 27 Oct 2024 17:15:54 +0100 Subject: [PATCH] board/common: fix rauc compatible regression The new variable INFIX_COMPATIBLE, used for the RAUC compatible string, is not properly evaluated on defconfigs where it is composed of another variable, e.g. INFIX_COMPATIBLE="${INFIX_IMAGE_ID}" Unfortunately, this is the default value for INFIX_COMPATIBLE, and so it breaks all tier one defconfigs on the mainline branch since a1771ff. Signed-off-by: Joachim Wiberg --- board/common/lib.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/board/common/lib.sh b/board/common/lib.sh index affa806e9..89f7e61a8 100644 --- a/board/common/lib.sh +++ b/board/common/lib.sh @@ -16,13 +16,22 @@ die() # DISK_IMAGE_SIZE="512" # etc. # +# Nested variables, like INFIX_COMPATIBLE="${INFIX_IMAGE_ID}" +# are handled by sourcing the file in a subshell. +# # shellcheck disable=SC1090 load_cfg() { tmp=$(mktemp -p /tmp) + ( + . "$BR2_CONFIG" 2>/dev/null - grep -E "${1}.*=" "$BR2_CONFIG" >"$tmp" - . "$tmp" + # Set *all* matching variables + set | grep -E "^${1}[^=]*=" | while IFS= read -r line; do + echo "$line" + done + ) > "$tmp" + . "$tmp" rm "$tmp" }