From: Michael Pruznick <michael_pruznick@mvista.com>
To: linux-mips@linux-mips.org
Subject: PATCH:2.4:CONFIG_CMDLINE_BOOL
Date: Wed, 06 Aug 2003 14:12:35 -0600 [thread overview]
Message-ID: <3F316133.3FF2C9EC@mvista.com> (raw)
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
next reply other threads:[~2003-08-06 20:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-06 20:12 Michael Pruznick [this message]
2003-08-06 21:01 ` PATCH:2.4:CONFIG_CMDLINE_BOOL Jun Sun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F316133.3FF2C9EC@mvista.com \
--to=michael_pruznick@mvista.com \
--cc=linux-mips@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox