From: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
To: Sascha Hauer <s.hauer@pengutronix.de>,
"open list:BAREBOX" <barebox@lists.infradead.org>
Cc: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Miquèl Raynal" <miquel.raynal@bootlin.com>,
"Hervé Codina" <herve.codina@bootlin.com>,
"Thomas Bonnefille" <thomas.bonnefille@bootlin.com>
Subject: [PATCH] bootm: add fitimage command line to bootargs
Date: Thu, 27 Aug 2026 14:16:47 +0200 [thread overview]
Message-ID: <20260827-add-cmdline-fitimage-v1-1-56701e1f0093@bootlin.com> (raw)
Since FIT image specification v0.9, it is now possible to pass command
line arguments for the next boot stage in FIT images.
Add parsing of the cmdline optional property when reading the fitimage.
This create a `linux.bootargs.fit` global variable that will be appended
to the command line when CONFIG_FLEXIBLE_BOOTARGS is enabled.
Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
---
common/bootm-fit.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/common/bootm-fit.c b/common/bootm-fit.c
index f7742b8717..313d12ca74 100644
--- a/common/bootm-fit.c
+++ b/common/bootm-fit.c
@@ -3,6 +3,7 @@
#include <bootm.h>
#include <image-fit.h>
#include <bootm-fit.h>
+#include <globalvar.h>
#include <memory.h>
#include <string.h>
#include <zero_page.h>
@@ -97,6 +98,18 @@ static bool bootm_fit_config_valid(struct fit_handle *fit,
return !!fit_has_image(fit, config, "kernel");
}
+static void bootm_fit_config_cmdline(struct device_node *config)
+{
+ const char *cmdline;
+
+ if (of_property_read_string(config, "cmdline", &cmdline))
+ return;
+
+ globalvar_add_simple("linux.bootargs.fit", cmdline);
+
+ pr_info("Using command line from FIT configuration: %s\n", cmdline);
+}
+
static enum filetype bootm_fit_update_os_header(struct image_data *data)
{
size_t size;
@@ -146,6 +159,8 @@ int bootm_open_fit(struct image_data *data, bool override)
goto err;
}
+ bootm_fit_config_cmdline(fit_config);
+
loadable_from_fit_os(data, fit, fit_config);
if (override)
data->is_override.os = true;
---
base-commit: df1055a2e0ddd3f96939327f2f0eb9db13a2bdc6
change-id: 20260827-add-cmdline-fitimage-42f6b2e930c1
Best regards,
--
Thomas Bonnefille <thomas.bonnefille@bootlin.com>
next reply other threads:[~2026-08-27 12:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 12:16 Thomas Bonnefille [this message]
2026-08-27 14:16 ` Ahmad Fatoum
2026-08-27 15:08 ` 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=20260827-add-cmdline-fitimage-v1-1-56701e1f0093@bootlin.com \
--to=thomas.bonnefille@bootlin.com \
--cc=barebox@lists.infradead.org \
--cc=herve.codina@bootlin.com \
--cc=miquel.raynal@bootlin.com \
--cc=s.hauer@pengutronix.de \
--cc=thomas.petazzoni@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