[PATCH 12/17] bootwrapper: Make set_cmdline() create /chosen if it doesn't exist.

Scott Wood scottwood at freescale.com
Sat Mar 17 04:29:07 EST 2007


Signed-off-by: Scott Wood <scottwood at freescale.com>
---
 arch/powerpc/boot/main.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c
index 506d7db..d0c588c 100644
--- a/arch/powerpc/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -245,9 +245,11 @@ static void get_cmdline(char *buf, int size)
 
 void set_cmdline(const char *buf)
 {
-	void *devp;
+	void *devp = finddevice("/chosen");
 
-	if ((devp = finddevice("/chosen")))
+	if (!devp)
+		devp = create_node(NULL, "/chosen");
+	if (devp)
 		setprop(devp, "bootargs", buf, strlen(buf) + 1);
 }
 
-- 
1.5.0.3




More information about the Linuxppc-dev mailing list