NFS Root with Raspberry Pi (nfs_diskless: no interface)

Rick Macklem rmacklem at uoguelph.ca
Fri Sep 25 23:24:49 UTC 2015


Ian Lepore wrote:
> On Thu, 2015-09-24 at 19:54 +0200, Hans Petter Selasky wrote:
> > On 09/24/15 18:36, Randy Westlund wrote:
> > > On Thu, Sep 24, 2015 at 08:37:06AM -0600, Ian Lepore wrote:
> > 
> > >>>[orig problem description: basically nfsroot without BOOTP fails]
> > 
> > >> Try setting boot.netif.name="ue0" in loader.conf.  I've never tried
> > >> that, but in looking at the code, there's some chance it could work.  :)
> > >>
> > >> What I do is put these options into my RPi kernel config:
> > >>
> > >> options 	BOOTP
> > >> options 	BOOTP_NFSROOT
> > >> options 	BOOTP_NFSV3
> > >> options 	BOOTP_WIRED_TO=ue0
> > >>
> > >> But this requires configuring a bootp or dhcp server to provide the
> > >> info.  It should be possible to netboot without using BOOTP.
> > >>
> > >> -- Ian
> > >
> > > No luck with boot.netif.name.
> > >
> > > I'm using the kernel that comes in the FreeBSD RPI-B disk image.  Is
> > > there a way to see what it was built with?  I tried running strings on
> > > the kernel, but I'm not sure what to look for.  Otherwise I guess I'll
> > > build one myself.
> > >
> > > Randy
> > >
> > 
> > Hi,
> > 
> > The problem is that the code in:
> > 
> > sys/nfs/bootp_subr.c: SYSINIT(bootp_rootconf, SI_SUB_ROOT_CONF,
> > SI_ORDER_FIRST, bootpc_init, NULL);
> > 
> > doesn't wait for the USB ethernet device to be enumerated. Only the
> > vfs_mountroot() code which is running from the init-process does so.
> > 
> > Not sure what the best way to solve this is. Try putting:
> > 
> > pause("W", hz * 4);
> > 
> > Into the beginning of the "bootpc_init()" function.
> > 
> > --HPS
> 
> I had time to look into this today.  The bootpc_init() routine *does*
> wait for an interface to appear.  The problem in this case is that BOOTP
> isn't involved, and the nfs_setup_diskless() routine doesn't have a
> similar wait loop for slow interfaces.  The attached patch adds it, and
> with it I can nfsmount root on my RPi without using the BOOTP_foo
> options I listed above.
> 
> Rick, does this patch look okay to you?  If no objections, I'll commit
> this asap.
> 
Looks fine to me. (I might have selected a name for the timeout with NFS
in it, just in case someone defines IFACE_TIMEOUT_SECS for something else,
but I'll leave it up to you.)

Thanks for patching this, rick

> -- Ian
> 
> 
> 
> [Text Documents:nfs_diskless_iface_timeout.diff]
> 


More information about the freebsd-arm mailing list