mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/4] bootm: define LINUX_BOOTARGS_BOOTM_EARLY/LATE in <bootm.h>
@ 2026-10-02 11:26 Ahmad Fatoum
  2026-10-02 11:26 ` [PATCH 2/4] amend! FIT: add cmdline to whitelist of non-hashed properties Ahmad Fatoum
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ahmad Fatoum @ 2026-10-02 11:26 UTC (permalink / raw)
  To: barebox; +Cc: Thomas Bonnefille, Ahmad Fatoum

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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-02 11:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 4/4] test: py: add test for fit cmdline parameter order Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox