mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH v2 2/2] MAKEALL: parse kconfig_add out of YAML files
Date: Mon, 17 Mar 2025 12:32:08 +0100	[thread overview]
Message-ID: <20250317113208.1863258-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20250317113208.1863258-1-a.fatoum@pengutronix.de>

Now that MAKEALL supports direct options in KCONFIG_ADD, teach it to
read runner kconfig_add keys out of the labgrid environment YAML files.

This is a further step towards removal of test/emulate.pl.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
v1 -> v2:
  - no change
---
 MAKEALL            | 13 +++++++++++++
 test/Containerfile |  1 +
 2 files changed, 14 insertions(+)

diff --git a/MAKEALL b/MAKEALL
index bc612b45561f..a9409fbf7b07 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -422,6 +422,19 @@ else
 		if [[ $i =~ ^.*/([^/]+)/([^@]*@|)([^.]+).yaml$ ]]; then
 			arch=${BASH_REMATCH[1]}
 			defconfig=${BASH_REMATCH[3]}
+
+			if grep -q "^\s\+kconfig_add:" $i; then
+				if command -v yq 2>&1 >/dev/null; then
+					KCONFIG_ADD="${KCONFIG_ADD} $(yq -M -r \
+					'.targets.main.runner.kconfig_add |
+					keys[] as $k | .[$k]' < $i)"
+				else
+					echo "WARNING: yq command not found in path" >&2
+					echo "WARNING: ignoring kconfig_add in $i" >&2
+					echo
+				fi
+			fi
+
 			do_build_defconfig $arch $defconfig
 			if [ $? -eq 0 ]; then
 				do_test_defconfig $config $defconfig "${pytest_opts[@]}"
diff --git a/test/Containerfile b/test/Containerfile
index db43d039b922..53a5443e48fe 100644
--- a/test/Containerfile
+++ b/test/Containerfile
@@ -51,6 +51,7 @@ RUN apt-get update && apt-get install -y \
 	sudo \
 	u-boot-tools \
 	yamllint \
+	yq \
 	&& rm -rf /var/lib/apt/lists/*
 
 ENV GCC_VERSION=14.2.0
-- 
2.39.5




  reply	other threads:[~2025-03-17 11:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-17 11:32 [PATCH v2 1/2] MAKEALL: support direct options for KCONFIG_ADD Ahmad Fatoum
2025-03-17 11:32 ` Ahmad Fatoum [this message]
2025-03-17 12:28 ` Sascha Hauer

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=20250317113208.1863258-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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