From: Alexander Shiyan <eagle.alexander923@gmail.com>
To: barebox@lists.infradead.org
Cc: Alexander Shiyan <eagle.alexander923@gmail.com>
Subject: [PATCH] bootm: filter out "<NULL>" rootopts to avoid kernel cmdline noise
Date: Thu, 16 Apr 2026 15:55:12 +0300 [thread overview]
Message-ID: <20260416125512.3275056-1-eagle.alexander923@gmail.com> (raw)
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@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
next reply other threads:[~2026-04-16 12:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 12:55 Alexander Shiyan [this message]
2026-04-17 8:44 ` Sascha Hauer
2026-04-17 11:03 ` Alexander Shiyan
2026-04-20 7:58 ` Sascha Hauer
2026-04-17 11:11 ` Alexander Shiyan
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=20260416125512.3275056-1-eagle.alexander923@gmail.com \
--to=eagle.alexander923@gmail.com \
--cc=barebox@lists.infradead.org \
/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