[PATCH] bootm: filter out "<NULL>" rootopts to avoid kernel cmdline noise
Alexander Shiyan
eagle.alexander923 at gmail.com
Thu Apr 16 05:55:12 PDT 2026
When rootopts is set to the literal string "<NULL>" (e.g., due to a
missing or invalid value in cdev_get_linux_root_and_opts), the resulting
kernel command line contains "root=/dev/... <NULL>", which is invalid
and may cause boot failures or confusion.
This patch checks for the "<NULL>" string in rootopts and replaces it
with NULL before calling format_root_bootarg(), effectively omitting
the erroneous token from the command line.
Signed-off-by: Alexander Shiyan <eagle.alexander923 at gmail.com>
---
common/bootm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/common/bootm.c b/common/bootm.c
index d43079bb81..0f0774dc32 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -688,6 +688,9 @@ int bootm_boot(struct bootm_data *bootm_data)
} else {
char *rootarg;
+ if (rootopts && !strcmp(rootopts, "<NULL>"))
+ rootopts = NULL;
+
rootarg = format_root_bootarg(bootm_data->root_param, root, rootopts);
pr_info("Adding \"%s\" to Kernel commandline\n", rootarg);
globalvar_add_simple("linux.bootargs.bootm.appendroot",
--
2.52.0
More information about the barebox
mailing list