kernel enviroment in sysctl MIB

Craig Boston craig at tobuj.gank.org
Tue Jan 27 08:45:03 PST 2004


On Sunday 09 November 2003 10:34 am, Reinier Kleipool wrote:
>   I am investigating the possiblilies for looking at the kernel boot
> parameters from within a userland utility. (Possibly a new FreeBSD install
> facility) The idea is that by looking at sysctl kern.environment.* you
> should be able to see the BTX variables. An install program could use this
> to see an INSTALL_SERVER=install.company.com variable (etc...) to use as
> install server. The BTX loader could provide these variables at install
> boot time, thus enableing fully automated installs.

I've been using the 'kenv' program for some time to do this.  For my purposes 
it seems to work quite well (have loader display a menu with an option of 
whether or not to start X after bootup).

It seems to do the trick for me -- if you need it from a program rather than a 
shell script you may want to look at the source for kenv(1) to see how it 
gets its information.

Craig



More information about the freebsd-hackers mailing list