From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Thomas Bonnefille <thomas.bonnefille@bootlin.com>,
Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 4/4] test: py: add test for fit cmdline parameter order
Date: Fri, 2 Oct 2026 13:26:34 +0200 [thread overview]
Message-ID: <20261002112648.2899729-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20261002112648.2899729-1-a.fatoum@pengutronix.de>
The order of the FIT cmdline is important as we want boot scripts and
boot entry files (blspec, EXTLINUX) to be able to robustly append options
after it.
Extend the test to check that this is the case and while at it, also
verify that it doesn't survive beyond the bootm call.
Cc: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
test/py/test_fit.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/test/py/test_fit.py b/test/py/test_fit.py
index b4c01459924e..2e866a28266a 100644
--- a/test/py/test_fit.py
+++ b/test/py/test_fit.py
@@ -87,6 +87,13 @@ def test_fit_dryrun(barebox, strategy, fitimage):
# If we actually did boot, this variable would be undefined
barebox.run_check('[ "$global.dryrun_attempts" = 5 ]')
+ # Apply fixups and check the FIT's cmdline did not outlive bootm -d
+ stdout = barebox.run_check("of_dump -F -p /chosen")
+ for line in stdout:
+ if line.startswith("bootargs"):
+ assert "fit.param" not in line, \
+ f"FIT cmdline survived bootm dry run: {line}"
+
def test_fit(barebox, strategy, fitimage):
# Sanity check, this is only fixed up on first boot
@@ -112,6 +119,7 @@ def test_fit(barebox, strategy, fitimage):
actual_size = int(fileinfo.split()[1])
boottarget = generate_bootscript(barebox, fitimage)
+ barebox.run_check("global linux.bootargs.dyn.bootentries=entry.param")
with strategy.boot_barebox(boottarget) as barebox:
assert of_get_property(barebox, "/chosen/barebox-version") == ver, \
@@ -125,6 +133,12 @@ def test_fit(barebox, strategy, fitimage):
assert "barebox.chainloaded" in bootargs
assert "fit.param" in bootargs
+ # The FIT's cmdline comes first, so everything else can override it
+ assert bootargs.index("fit.param") < bootargs.index("barebox.chainloaded"), \
+ "fit.param found later than bootargs set by scripts"
+ assert bootargs.index("fit.param") < bootargs.index("entry.param"), \
+ "fit.param found later than bootargs set by boot entries"
+
initrd_start = of_get_property(barebox, "/chosen/linux,initrd-start", ncells=0)
initrd_end = of_get_property(barebox, "/chosen/linux,initrd-end", ncells=0)
initrd_size = initrd_end - initrd_start
--
2.47.3
prev parent reply other threads:[~2026-10-02 11:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 11:26 [PATCH 1/4] bootm: define LINUX_BOOTARGS_BOOTM_EARLY/LATE in <bootm.h> Ahmad Fatoum
2026-10-02 11:26 ` [PATCH 2/4] amend! FIT: add cmdline to whitelist of non-hashed properties Ahmad Fatoum
2026-10-02 11:26 ` [PATCH 3/4] amend! bootm: add fitimage command line to bootargs Ahmad Fatoum
2026-10-02 11:26 ` Ahmad Fatoum [this message]
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=20261002112648.2899729-4-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=thomas.bonnefille@bootlin.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