From owner-freebsd-arch Fri Mar 8 10:24:59 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 68CB137B404 for ; Fri, 8 Mar 2002 10:24:54 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id FAA01153; Sat, 9 Mar 2002 05:24:44 +1100 Date: Sat, 9 Mar 2002 05:25:28 +1100 (EST) From: Bruce Evans X-X-Sender: To: Garance A Drosihn Cc: Luigi Rizzo , Subject: Re: Proposed patch: kern.bootdev* sysctl variables In-Reply-To: Message-ID: <20020309051737.V4183-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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