[PATCH] ppc64: Fix default command line

Benjamin Herrenschmidt benh at kernel.crashing.org
Mon Nov 22 12:48:15 EST 2004


Hi !

The ppc64 kernel can be built with a default command line (CONFIG_CMDLINE)
for cases where none is provided by the firmware. 
However, some OF implementation always pass a "bootargs" property that only
contains the "0" terminating byte of a C string which caused us to think
there was a command line, and not use the built-in one. This patch fixes it.

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>

Index: linux-work/arch/ppc64/kernel/prom.c
===================================================================
--- linux-work.orig/arch/ppc64/kernel/prom.c	2004-11-22 11:59:42.918494552 +1100
+++ linux-work/arch/ppc64/kernel/prom.c	2004-11-22 12:45:41.563116824 +1100
@@ -823,7 +823,7 @@
 			strlcpy(cmd_line, p, min(l, COMMAND_LINE_SIZE));
 	}
 #ifdef CONFIG_CMDLINE
-	if (l == 0) /* dbl check */
+	if (l == 0 || (l == 1 && (*p) == 0))
 		strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
 #endif /* CONFIG_CMDLINE */
 





More information about the Linuxppc64-dev mailing list