Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Mar 2002 05:25:28 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Garance A Drosihn <drosih@rpi.edu>
Cc:        Luigi Rizzo <rizzo@icir.org>, <arch@FreeBSD.ORG>
Subject:   Re: Proposed patch: kern.bootdev* sysctl variables
Message-ID:  <20020309051737.V4183-100000@gamplex.bde.org>
In-Reply-To: <p05101521b8aea9bba209@[128.113.24.47]>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 8 Mar 2002, Garance A Drosihn wrote:

> At 2:00 AM -0800 3/8/02, 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 definitely like the goal.
>
> >(I know it can be perfected by not assuming that
> >any hard disk is /dev/ad, but you get the idea...)
>
> My machines tend to have scsi drives (and some of them have only
> scsi hard drives), and I can also boot off of CD's.  If something
> like this is added, I think it pretty much has to give the correct
> answer in all cases.  If not, it should give a helpful clue, but
> not guess at the answer and then present that guess as fact..
>
> Ie, instead of "/dev/ad%ds%d", maybe return "disk%ds%d"...

I think this doesn't belong in i386/autoconf.c.  Old versions of
i386/autoconfig.c determined the driver name correctly, but the
code for this has mostly migrated to mostly-MI code in kern/vfs_conf.c
and kern/subr_disk.c.  The MI code can determine the boot device just
as easily as it can determine to root device, given suitable input.

Bruce


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?20020309051737.V4183-100000>