In article <[EMAIL PROTECTED]> you wrote:
> On Tue, Mar 12, 2002 at 04:38:42PM +0200, Vladimir Terziev wrote:
>> > >  I have to configure a box, which has to run different startup
>> > > scrips on behalf of loaded kernel and kernel modules at startup.
[...]
>> How can I understand, when the startup scripts are going to be runned,
>> which menu item is choosed ?

> I think that your scripts should set some variables in the loader's
> environment that can later be passed on to the kernel and read by
> userland utilities (including startup scripts) - see kenv(1).

Yes, you can set a variable in bootforth with
: foo
  s" value"
  s" my_var"
  setenv
;

OK foo
OK

and, in a startup script, read it with kenv | grep "my_var" .

(There's a bug in setenv when used interactively; it uses the variable's
name as its value, too.  But it works correctly when used in the
definition of a word.)

Another (too fancy) way would be to use a file (bootforth has fopen,
fread, fwrite, fclose).

See libstand(3) and src/sys/boot/ficl/loader.c for more details.

Bye, Philipp

-- 
http://www.uni-karlsruhe.de/~un1i/                          (,.)
                                                          \\\@@ )
                                                            \= )
                                                            cc_|\_,^

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to