[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] - allow specification of alternate inittab files
From:       "B Thomas" <bjthomas3 () gmail ! com>
Date:       2006-10-31 23:51:27
Message-ID: a8a6bd980610311551o6d258aa0gdfc2cc6d1a159c45 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hey, you're probably correct.  It was a long, twisty path before I got to
the final patch including many detours and changes of direction.  Let me
rework it with the environment variables and resubmit.

Thanks,
-b


On 10/31/06, Denis Vlasenko <vda.linux@googlemail.com> wrote:
>
> On Tuesday 31 October 2006 23:22, B Thomas wrote:
> > Hi,
> >
> > There are circumstances in which it would be great to allow the
> selection of
> > different inittab file at boot time. This patch adds the ability to
> select
> > the inittab file via a command line option (bb_inittab).
> >
> > One of the things that I don't like about this patch is the need to
> mount
> > /proc on systems in which it isn't mounted.  The mount is cleaned up and
> > handled carefully; I just don't like having to do it.  Having said that,
> > this patch has proven to be quite useful.
> >
> > Signed-off-by: Ben Thomas (ben@virtualiron.com)
>
> I thought that all unrecognized kernel params are passed in the
> environment
> to init: kernel tree, init/main.c:
>
> /*
> * Unknown boot options get handed to init, unless they look like
> * failed parameters
> */
> static int __init unknown_bootoption(char *param, char *val)
> {
> ....
>         if (val) {
>                 /* Environment option */
>                 unsigned int i;
>                 for (i = 0; envp_init[i]; i++) {
>                         if (i == MAX_INIT_ENVS) {
>                                 panic_later = "Too many boot env vars at
> `%s'";
>                                 panic_param = param;
>                         }
>                         if (!strncmp(param, envp_init[i], val - param))
>                                 break;
>                 }
> ....
>
> So you do not need to parse /proc/commandline
> --
> vda
>

[Attachment #5 (text/html)]

Hey, you're probably correct.&nbsp; It was a long, twisty path before I got
to the final patch including many detours and changes of direction.&nbsp;
Let me rework it with the environment variables and resubmit.<br>
<br>
Thanks,<br>
-b<br>
<br><br><div><span class="gmail_quote">On 10/31/06, <b class="gmail_sendername">Denis \
Vlasenko</b> &lt;<a href="mailto:vda.linux@googlemail.com">vda.linux@googlemail.com</a>&gt; \
wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, \
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> On Tuesday 31 October 2006 \
23:22, B Thomas wrote:<br>&gt; Hi,<br>&gt;<br>&gt; There are circumstances in which \
it would be great to allow the selection of<br>&gt; different inittab file at boot \
time. This patch adds the ability to select <br>&gt; the inittab file via a command \
line option (bb_inittab).<br>&gt;<br>&gt; One of the things that I don't like about \
this patch is the need to mount<br>&gt; /proc on systems in which it isn't \
mounted.&nbsp;&nbsp;The mount is cleaned up and <br>&gt; handled carefully; I just \
don't like having to do it.&nbsp;&nbsp;Having said that,<br>&gt; this patch has \
proven to be quite useful.<br>&gt;<br>&gt; Signed-off-by: Ben Thomas (<a \
href="mailto:ben@virtualiron.com">ben@virtualiron.com </a>)<br><br>I thought that all \
unrecognized kernel params are passed in the environment<br>to init: kernel tree, \
init/main.c:<br><br>/*<br> * Unknown boot options get handed to init, unless they \
look like<br> * failed parameters <br> */<br>static int __init \
unknown_bootoption(char *param, char \
*val)<br>{<br>....<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (val) \
{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* \
Environment option */<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unsigned \
int i;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for \
(i = 0; envp_init[i]; i++) { \
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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bsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>....<br><br>So \
you do not need to parse /proc/commandline<br>--<br>vda<br></blockquote> </div><br>



_______________________________________________
busybox mailing list
busybox@busybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic