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 1/4] bootm: define LINUX_BOOTARGS_BOOTM_EARLY/LATE in <bootm.h>
Date: Fri, 2 Oct 2026 13:26:31 +0200 [thread overview]
Message-ID: <20261002112648.2899729-1-a.fatoum@pengutronix.de> (raw)
We had previously laid out a prefix convention for the Linux command
line options added by bootm, but only the late variant was added as
nothing yet needed the early one.
The FIT cmdline support will need it and lives outside bootm.c, so let's
introduce LINUX_BOOTARGS_BOOTM_EARLY and move both prefixes into the
header.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
Please reorder before Thomas' FIT command-line series
---
Documentation/user/booting-linux.rst | 4 ++++
common/bootm.c | 14 +-------------
include/bootm.h | 14 ++++++++++++++
3 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/Documentation/user/booting-linux.rst b/Documentation/user/booting-linux.rst
index 529d4de5c5b8..de40b6a57dc0 100644
--- a/Documentation/user/booting-linux.rst
+++ b/Documentation/user/booting-linux.rst
@@ -112,6 +112,10 @@ their ``linux.bootargs.``-prefixed parameter names.
Kernel command line arguments that barebox generates internally are not
interleaved with externally provided command-line arguments:
+* Following arguments will be concatenated **before** all other options:
+
+ * the ``cmdline`` property of the booted FIT image configuration
+
* Following arguments will be concatenated **after** all other options:
* ``root=`` and ``rootwait=`` controlled by :ref:`global.bootm.appendroot <magicvar_global_bootm_appendroot>`
diff --git a/common/bootm.c b/common/bootm.c
index 27da1a590bf1..90b99d62b01e 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -22,19 +22,6 @@
#include <security/config.h>
#include <security/policy.h>
-/*
- * All device parameter iteration happens in lexicographical order.
- * To ensure that bootm options are consistently applied before or after
- * other options from the environment or boot configuration files, we
- * employ following convention for the prefix:
- *
- * ! 0x21 is less than any non-space printable character
- * ~ 0x7e is greater than any printable character
- *
- * Users will never see those as bootm_boot_cleanup() will delete them again.
- */
-#define LINUX_BOOTARGS_BOOTM_LATE "linux.bootargs.~bootm."
-
static LIST_HEAD(handler_list);
static struct sconfig_notifier_block sconfig_notifier;
@@ -803,6 +790,7 @@ void bootm_boot_cleanup(struct image_data *data)
if (data->of_root_node)
of_delete_node(data->of_root_node);
+ globalvar_remove(LINUX_BOOTARGS_BOOTM_EARLY "*");
globalvar_remove(LINUX_BOOTARGS_BOOTM_LATE "*");
free(data->os_header);
free(data->os_file);
diff --git a/include/bootm.h b/include/bootm.h
index 946713971eb5..8e574040f497 100644
--- a/include/bootm.h
+++ b/include/bootm.h
@@ -7,6 +7,20 @@
#include <linux/list.h>
#include <loadable.h>
+/*
+ * All device parameter iteration happens in lexicographical order.
+ * To ensure that bootm options are consistently applied before or after
+ * other options from the environment or boot configuration files, we
+ * employ following convention for the prefix:
+ *
+ * ! 0x21 is less than any non-space printable character
+ * ~ 0x7e is greater than any printable character
+ *
+ * Users will never see those as bootm_boot_cleanup() will delete them again.
+ */
+#define LINUX_BOOTARGS_BOOTM_EARLY "linux.bootargs.!bootm."
+#define LINUX_BOOTARGS_BOOTM_LATE "linux.bootargs.~bootm."
+
enum bootm_verify {
BOOTM_VERIFY_NONE,
BOOTM_VERIFY_HASH,
--
2.47.3
next reply other threads:[~2026-10-02 11:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 11:26 Ahmad Fatoum [this message]
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 ` [PATCH 4/4] test: py: add test for fit cmdline parameter order Ahmad Fatoum
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-1-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