Subject: nfs_boot DHCP output
To: None <current-users@NetBSD.ORG>
From: Martin Husemann <>
List: current-users
Date: 02/19/2001 22:52:11
I've just been confused by this and would like others opinions on this:

I've booted a system (kernel loaded from local hard disk) with root on NFS,
via NFS_BOOT_DHCP. I first had my dhcpd configuration wrong, as I just added
a server-name but no next host. My dhcp server is not the machine serving
the root filesystem for this machine. When it was working I got this output:

boot device: wd0
root device (default wd0a): cs0
dump device: 
file system (default generic): nfs
root on cs0
nfs_boot: trying DHCP/BOOTP
nfs_boot: DHCP server:
nfs_boot: my_addr=
nfs_boot: my_mask=
nfs_boot: gateway=
root on setting-sun:/arm32

If you look at sys/nfs/nfs_bootdhcp.c you see where the pieces of this puzzle
come from (besides the boring details of my local network setup):

nfs_boot: DHCP server:
          ^            ^
         (1)          (2)

root on setting-sun:/arm32
        ^           ^
       (3)         (4)

These are:
2 = next-server option from the DHCP answer packet, in this case the server
    we will mount our root filesystem from
3 = server-name option from the DHCP packet. This seems to be only for
    display here
4 = root-path from dhcp

I, when naively reading the original output, would assume the DHCP server
that answered our query is at, which is wrong.
Furthermore, the next-server option is documented to be the server to load
the kernel from (which is not the case in this setup). Reading nfs_bootdhcp.c
you learn it's also the default IP for the root filesystem server.

I didn't find a way to set the IP for the root filesystem server in any other
way. I naively assumed "server-name" would do it (the DHCP packet should 
contain an appropriate DNS server address to resolve it).

So, now coming to the point of this mail:

IMHO there is a formatting error in the kernel output. There should be an
additional linefeed/slight reformatting:

nfs_boot: trying DHCP/BOOTP
nfs_boot: DHCP
root server:

I'm not sure the kernel dhcp stuff should jump to even more hooks to resolve
server name etc. When not verifying the server-name, it maybe should not be
printed as host name but as IP address (which would be redundant with the
root server output above).

Quite confused...