[PATCH 2/2] lib: cmdlinepart: support RO both in lower and upper case

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Jan 14 02:13:02 PST 2026


The help text of the addpart command lists RO as being uppercase,
but the code expects it to be lower-case.

Resolve this by supporting either case.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 lib/cmdlinepart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/cmdlinepart.c b/lib/cmdlinepart.c
index 3e8c415c7ea6..16fa4605d822 100644
--- a/lib/cmdlinepart.c
+++ b/lib/cmdlinepart.c
@@ -74,7 +74,7 @@ int cmdlinepart_do_parse_one(const char *devname, const char *partstr,
 
 	partstr = end;
 
-	if (*partstr == 'r' && *(partstr + 1) == 'o') {
+	if (!strncasecmp(partstr, "ro", 2)) {
 		flags |= DEVFS_PARTITION_READONLY;
 		end = (char *)(partstr + 2);
 	}
-- 
2.47.3




More information about the barebox mailing list