From owner-freebsd-current@FreeBSD.ORG Thu Jan 31 11:53:38 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 1B504CA4 for ; Thu, 31 Jan 2013 11:53:38 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 572B5E88 for ; Thu, 31 Jan 2013 11:53:36 +0000 (UTC) Received: (qmail 35526 invoked from network); 31 Jan 2013 13:13:21 -0000 Received: from unknown (HELO [62.48.0.94]) ([62.48.0.94]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 31 Jan 2013 13:13:21 -0000 Message-ID: <510A5B32.4070501@freebsd.org> Date: Thu, 31 Jan 2013 12:53:22 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: "Eggert, Lars" Subject: Re: mounting root from NFS via ROOTDEVNAME References: <19F92E0C-F004-4F16-A5FC-A10DF84BDCCF@netapp.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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: Thu, 31 Jan 2013 11:53:38 -0000 On 31.01.2013 12:27, Eggert, Lars wrote: > Hi, > > On Jan 30, 2013, at 22:43, Craig Rodrigues wrote: >> What you need to do is, before the FreeBSD kernel boots, your >> loader needs to export some environment variables. This will trigger >> the various behaviors in the FreeBSD mount code. > > the loader can export some environment variables (this is how I get the serial console working.) > >> So as I suggested before, you should continue with: >> >> (1) Have /usr/home/elars/dst/etc/fstab with: >> # Options Dump Pass >> 10.11.12.13:/usr/home/elars/dst/ / nfs ro 0 0 > > Done. > >> (2) From your loader, you need to export this environment variable, so >> that the kernel can get it with getenv(). You need at least: >> >> vfs.root.mountfrom=nfs:10.11.12.13:/usr/home/elars/dst > > Done. > >> Now, there are some other environment variables you need to export from the >> loader. >> >> boot.netif.ip >> boot.netif.netmask >> boot.netif.gateway >> boot.nfsroot.server >> boot.nfsroot.path > > Done. I also ripped out all the BOOTP* options from the kernel. > > However, this still fails: > > Trying to mount root from nfs:10.11.12.13:/usr/home/elars/dst []... > mountroot: waiting for device 10.11.12.13:/usr/home/elars/dst ... > Mounting from nfs:10.11.12.13:/usr/home/elars/dst failed with error 19. > > Loader variables: > vfs.root.mountfrom=nfs:10.11.12.13:/usr/home/elars/dst > > Manual root filesystem specification: > : [options] > Mount using filesystem > and with the specified (optional) option list. > > eg. ufs:/dev/da0s1a > zfs:tank > cd9660:/dev/acd0 ro > (which is equivalent to: mount -t cd9660 -o ro /dev/acd0 /) > > ? List valid disk boot devices > . Yield 1 second (for background tasks) > Abort manual input > > mountroot> > > I did a tcpdump and no traffic shows up on the correct interface (em4). I guess I need to set yet another loader environment variable to indicate which interface I'd like to use. Looking at the source, I only see boot.netif.name, but setting that to em4 doesn't help either. > > Any further ideas? The interface doesn't have a name during loader stage. The kernel finds the interface to use based on the MAC address. You should set boot.netif.hwaddr as well in the kernel environment. -- Andre