[PATCH] Externally visible buffer for CONFIG_CMDLINE
Paul Mackerras
paulus at samba.org
Mon Aug 8 15:32:32 EST 2005
Michal Ostrowski writes:
> 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.)
> +#ifdef CONFIG_CMDLINE
> +const char builtin_cmdline[COMMAND_LINE_SIZE]
> + __attribute__((section("__builtin_cmdline"))) = CONFIG_CMDLINE;
> +#endif
Where does the __builtin_cmdline section get linked, given that it
isn't mentioned explicitly in the vmlinux.lds?
> #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
We seem to have gained an extra unnecessary pair of braces and lost
the comment on the #endif.
Paul.
More information about the Linuxppc64-dev
mailing list