[PATCH] Externally visible buffer for CONFIG_CMDLINE

Michal Ostrowski mostrows at watson.ibm.com
Tue Jul 5 09:36:52 EST 2005


Define a fixed buffer to store the CONFIG_CMDLINE string and the buffer 
in it's own section.  This allows for one to easily locate this buffer 
in the vmlinux file (using objdump) and then use dd to change the 
command line. (Allows one to avoid re-building everything to change the 
command line when using hardware where the only command line is the 
built-in one.)


---

Signed-off-by: Michal Ostrowski <mostrows at watson.ibm.com

 arch/ppc64/kernel/prom.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

Index: arch/ppc64/kernel/prom.c
===================================================================
--- de5a3cb87a4731d8b8c075c6de4800fe52f5bc70/arch/ppc64/kernel/prom.c  (mode:100644)
+++ 656a2d92ea72f6a60942b8eaf4d3370d0bf67ea3/arch/ppc64/kernel/prom.c  (mode:100644)
@@ -72,6 +72,11 @@
        u32 size;
 };
 
+#ifdef CONFIG_CMDLINE
+const char builtin_cmdline[COMMAND_LINE_SIZE]
+       __attribute__((section("__builtin_cmdline"))) = CONFIG_CMDLINE;
+#endif
+
 
 typedef int interpret_func(struct device_node *, unsigned long *,
                           int, int, int);
@@ -868,10 +873,12 @@
                if (p != NULL && l > 0)
                        strlcpy(cmd_line, p, min(l, COMMAND_LINE_SIZE));
        }
+
 #ifdef CONFIG_CMDLINE
-       if (l == 0 || (l == 1 && (*p) == 0))
-               strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
-#endif /* CONFIG_CMDLINE */
+       if (l == 0 || (l == 1 && (*p) == 0)) {
+               strlcpy(cmd_line, builtin_cmdline, sizeof(builtin_cmdline));
+       }
+#endif
 
        DBG("Command line is: %s\n", cmd_line);
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20050704/21299202/attachment.pgp 


More information about the Linuxppc64-dev mailing list