* PATCH:2.4:CONFIG_CMDLINE_BOOL
@ 2003-08-06 20:12 Michael Pruznick
2003-08-06 21:01 ` PATCH:2.4:CONFIG_CMDLINE_BOOL Jun Sun
0 siblings, 1 reply; 2+ messages in thread
From: Michael Pruznick @ 2003-08-06 20:12 UTC (permalink / raw)
To: linux-mips
The patch at the bottom of this message adds support so that
a board can choose to have a command line specified in
the .config file or hard-coded. This is similar to what is
in the ppc tree. All this patch does is create a config
question and store the info in the config file. It is up
to each board to read or not read this info.
Here is one example of its use:
>#ifndef CONFIG_CMDLINE_BOOL
>#define CONFIG_CMDLINE "console=ttyS0,38400 ip=any root=nfs rw"
>#endif
>char arcs_cmdline[CL_SIZE] = CONFIG_CMDLINE;
Dynamic setting of args like this will still work with out
any changes.
>#ifdef CONFIG_NE2000
> argptr = prom_getcmdline();
> if ((argptr = strstr(argptr, "ne_eth=")) == NULL) {
> argptr = prom_getcmdline();
> strcat(argptr, " ne_eth=0x6020280,29");
> }
>#endif
To you this you may need to modify this fn keeping two
things in mind. A) setting *arcs_cmdline to 0 unconditionally
will clear the .config/hard-coded default. B) If the board
supports a f/w command line string that should probably
over-ride and .config/hard-coded default.
>void __init
>prom_init_cmdline(int argc, char **argv)
>{
> int i; /* Always ignore the "-c" at argv[0] */
>
> /* ignore all built-in args if any f/w args given */
> if (argc > 1) {
> *arcs_cmdline = '\0';
> }
> for (i = 1; i < argc; i++) {
> if (i != 1) {
> strcat(arcs_cmdline, " ");
> }
> strcat(arcs_cmdline, argv[i]);
> }
>}
Index: config-shared.in
===================================================================
RCS file: /home/cvs/linux/arch/mips/Attic/config-shared.in,v
retrieving revision 1.1.2.80
diff -u -r1.1.2.80 config-shared.in
--- config-shared.in 5 Aug 2003 11:13:39 -0000 1.1.2.80
+++ config-shared.in 6 Aug 2003 19:52:41 -0000
@@ -891,6 +891,11 @@
fi
endmenu
+bool 'Default kernel loader arguments' CONFIG_CMDLINE_BOOL
+if [ "$CONFIG_CMDLINE_BOOL" = "y" ] ; then
+ string 'Initial kernel command string' CONFIG_CMDLINE ""
+fi
+
source drivers/mtd/Config.in
source drivers/parport/Config.in
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: PATCH:2.4:CONFIG_CMDLINE_BOOL
2003-08-06 20:12 PATCH:2.4:CONFIG_CMDLINE_BOOL Michael Pruznick
@ 2003-08-06 21:01 ` Jun Sun
0 siblings, 0 replies; 2+ messages in thread
From: Jun Sun @ 2003-08-06 21:01 UTC (permalink / raw)
To: Michael Pruznick; +Cc: linux-mips, jsun
On Wed, Aug 06, 2003 at 02:12:35PM -0600, Michael Pruznick wrote:
> The patch at the bottom of this message adds support so that
> a board can choose to have a command line specified in
> the .config file or hard-coded. This is similar to what is
> in the ppc tree. All this patch does is create a config
> question and store the info in the config file. It is up
> to each board to read or not read this info.
>
This is a good feature.
However, I think it is better to
1) always have CONFIG_CMDLINE defined
2) for boards that don't use it, it is "" (NULL string)
3) we need to modify all boards' prom_init routines so that they
respect this config.
4) (optionally) some ugly static ctrcpy of cmdline can now be
moved to use config options
Jun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-08-06 21:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-06 20:12 PATCH:2.4:CONFIG_CMDLINE_BOOL Michael Pruznick
2003-08-06 21:01 ` PATCH:2.4:CONFIG_CMDLINE_BOOL Jun Sun
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.