From owner-freebsd-current@FreeBSD.ORG Wed Jan 30 13:36:17 2013 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9122E3F2 for ; Wed, 30 Jan 2013 13:36:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 8FE5BA32 for ; Wed, 30 Jan 2013 13:36:15 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.6/8.14.6) with ESMTP id r0UDa8rH090494 for ; Wed, 30 Jan 2013 06:36:08 -0700 (MST) (envelope-from ian@FreeBSD.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r0UDZsSL023725; Wed, 30 Jan 2013 06:35:54 -0700 (MST) (envelope-from ian@FreeBSD.org) Subject: Re: mounting root from NFS via ROOTDEVNAME From: Ian Lepore To: "Eggert, Lars" In-Reply-To: References: <19F92E0C-F004-4F16-A5FC-A10DF84BDCCF@netapp.com> Content-Type: text/plain; charset="us-ascii" Date: Wed, 30 Jan 2013 06:35:54 -0700 Message-ID: <1359552954.93359.224.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Craig Rodrigues , "freebsd-current@freebsd.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2013 13:36:17 -0000 On Wed, 2013-01-30 at 09:32 +0000, Eggert, Lars wrote: > Hi, > > On Jan 29, 2013, at 20:22, Craig Rodrigues wrote: > > What kind of architecture are you trying to do this on? Is this > > i386/amd64 or something else? > > amd64 > > > I am not familiar with netboot compared to > > PXE. Is TFTP involved at all with netboot? > > TFTP is not involved. The kernel gets booted by our custom loader (over HTTP) and the root FS is supposed to be mounted over NFS. > > > What does your dhcpd configuration file look like? > > Completely standard, with the addition of a "root-path" option. (Which I would like to get rid of by setting ROOTDEVNAME in the kernel.) > > > Also, are you using the FreeBSD loader, or something else? What kinds of > > customizations have you done on the loader? > > Custom loader. > > > If through your setup you have already managed to load the kernel over > > the network, then a lot of the hard work has been done. Telling the kernel > > where the root file system is located becomes the next tricky part. > > Right, that's the step I am struggeling with. > > > In src/sys/boot/common/boot.c which is part of the loader (not the kernel), > > if you look in the getrootmount() function, > > you will see that the loader will try to figure out where the root file > > system > > is by parsing /etc/fstab, and looking for the "/" mount. > > > > So, if your kernel is located in: > > > > /usr/home/elars/dst/boot/kernel/kernel > > > > Then create a file /usr/home/elars/dst/etc/fstab file with something like: > > > > # Device Mountpoint FSType > > Options Dump Pass > > 10.11.12.13:/usr/home/elars/dst/ / nfs ro 0 0 > > Thanks, will try that! > > > Alternatively, if you don't want to create an /etc/fstab file, then > > you could put something like this in your loader.conf file: > > > > vfs.root.mountfrom=nfs:10.11.12.13:/usr/home/elars/dst > > Will try that too, but not sure if this works with our custom loader. > > Lars > > > > > If you can get this to work without introducing new kernel options, > > that would be ideal, because the kernel options you are > > enabling are triggering behaviors. > > Just FYI, I believe the current behavior of BOOTP and BOOTP_NFSROOT is a bug, and I've entered a PR for it http://www.freebsd.org/cgi/query-pr.cgi?pr=175671 I also put a little effort into changing the behavior so that BOOTP without BOOTP_NFSROOT gets you an address and then moves on to use the ROOTDEVNAME you have configured, but I didn't have any success yet (it stays stuck in the state of waiting for the root path). I intend to get back to it after wrapping up some other work, if someone else doesn't get to it first. -- Ian