Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 08 Mar 2002 11:10:37 +0100
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        Luigi Rizzo <rizzo@icir.org>, arch@FreeBSD.ORG
Subject:   Re: Proposed patch: kern.bootdev* sysctl variables 
Message-ID:  <15269.1015582237@critter.freebsd.dk>
In-Reply-To: Your message of "Fri, 08 Mar 2002 02:08:54 PST." <3C888DB6.8DF80EE7@mindspring.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <3C888DB6.8DF80EE7@mindspring.com>, Terry Lambert writes:
>Luigi Rizzo wrote:
>> Any objection to the following patch to i386/i386/autoconf.c
>> to let userland apps know [an approximation of] the name
>> of the device the kernel was booted from ?
>> 
>> The main use would be for startup scripts, such as
>> /etc/rc, which could this way differentiate their
>> behaviour based on the returned result.
>> 
>> (I know it can be perfected by not assuming that
>> any hard disk is /dev/ad, but you get the idea...)
>
>If you grabbed the actual boot information from the
>tunables in the loader environment (using TUNABLE
>macros), you could get the actual thing.

But that might not be the real thing.  The kernel will
ask for a root if it's initial instruction is wrong,
so you cannot return the hint from the bootloader unless
you know for sure that you actually ended up using that.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15269.1015582237>