[PATCH] bootm: add fitimage command line to bootargs
Thomas Bonnefille
thomas.bonnefille at bootlin.com
Thu Aug 27 05:16:47 PDT 2026
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 at 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 at bootlin.com>
More information about the barebox
mailing list