Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jul 2014 09:57:28 -0600
From:      Ian Lepore <ian@FreeBSD.org>
To:        Beeblebrox <zaphod@berentweb.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Several minor annoyances on Current
Message-ID:  <1406303848.56408.16.camel@revolution.hippie.lan>
In-Reply-To: <1406289867854-5931678.post@n5.nabble.com>
References:  <1406282699515-5931653.post@n5.nabble.com> <1406287169575-5931665.post@n5.nabble.com> <1406289867854-5931678.post@n5.nabble.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-TBR0ovB1JJcy/N8kArLS
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

On Fri, 2014-07-25 at 05:04 -0700, Beeblebrox wrote:
> Kurt Jaeger wrote:
> 
> > Can you check whether one of your ethernet-ports has a double life
> > as IPMI port and that one sends out the DHCP ?
> 
> No such setup. This is my workstation, with wake-on-lan and pxe-boot
> disabled in bios.
> Checking boot messages provides a little more insight - Its not one but
> *both* NIC's that look for DHCP. Also, this is before root gets mounted, so
> what's in rc.conf is irrelevant:
> 
> Sending DHCP Discover packet from interface re0 (mac#)
> Sending DHCP Discover packet from interface re1 (mac#)
> Received DHCP Offer packet on re0 from 192.168.1.1 (accepted)
> Received DHCP Offer packet on re0 from 192.168.1.1 (ignored)
> Received DHCP Offer packet on re0 from 192.168.1.1 (ignored)
> Sending DHCP Request packet from interface re0 (mac#)
> Received DHCP Ack packet on re0 from 192.168.1.1 (accepted)
> DHCP timeout for interface re1
> re0 at 192.168.1.11 server 192.168.1.1
> subnet mask 255.255.255.0 router 192.168.1.1
> Adjusted interface re0
> Shutdown interface re1
> Trying to mount root from zfs:bsd []...
> 
> I compile and use the same kernel for both host and pxe-booted diskless
> clients. So my kernel config file has
> options         NFSCL                   # Network Filesystem Client
> options         NFS_ROOT                # NFS usable as /, requires NFSCL
> options         BOOTP                   # Needed for non-btx PXE
> options         BOOTP_NFSROOT           # Needed for non-btx PXE
> It's probably what's causing this behavior. Kernel must receive IP before it
> can try and mount an NFS volume as root. However, I would have assumed that
> the "vfs.root.mountfrom=" setting in loader.conf would be read before such
> attempt...
> 

I made changes last year that allowed vfs.root.mountfrom to
unconditionally override any path provided by the bootp/dhcp server.
While it overrides the server-provided path, it doesn't prevent
contacting the server (the override may be for a different nfs path).
See http://svnweb.freebsd.org/base?view=revision&revision=253847 for
details.

I didn't consider at the time that someone might want to avoid doing any
bootp configuration at all, but in retrospect I can think of several
good reasons to turn off bootp on a per-boot basis.  The attached patch
provides a knob for that, I'll commit it if there are no objections.

-- Ian


--=-TBR0ovB1JJcy/N8kArLS
Content-Disposition: inline; filename="bootp_disable.diff"
Content-Type: text/x-patch; name="bootp_disable.diff"; charset="us-ascii"
Content-Transfer-Encoding: 7bit

Index: sys/nfs/bootp_subr.c
===================================================================
--- sys/nfs/bootp_subr.c	(revision 268986)
+++ sys/nfs/bootp_subr.c	(working copy)
@@ -1551,8 +1551,11 @@ bootpc_init(void)
 	struct nfsv3_diskless *nd;
 	struct thread *td;
 	int timeout;
-	int delay;
+	int delay, disable;
 
+	if (TUNABLE_INT_FETCH("vfs.nfs.bootp_disable", &disable) && disable)
+		return;
+
 	timeout = BOOTP_IFACE_WAIT_TIMEOUT * hz;
 	delay = hz / 10;
 

--=-TBR0ovB1JJcy/N8kArLS--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1406303848.56408.16.camel>