tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Making dhcpcd work on diskless clients



I recently tried to follow up on the "rtsol has been removed" warning
and switch a diskless client (booting via in-kernel dhcp client and NFS
on /) to dhcpcd.

This did not work well: midway through the dhcpcd startup, NFS started
erroring out with EHOSTUNREACH.

After talking to Roy, there is no "good" reason for this, and testing shows
that running dhcpcd later works just fine, without interrupting the / mount.

This led to the following change in /etc/rc.d/dhcpcd:

--8<--
..
if ifconfig $( sysctl -n kern.root_device ) 2>/dev/null | fgrep flags= \
                | fgrep -q UP; then
        # a diskless client, try to make sure everything is in core
        echo A diskless client, trying to get dhpcpcd into buffers...
        cat /sbin/dhcpcd > /dev/null
fi

run_rc_command "$1"
-->8--

and this makes it work.

Can anyone think of a safer way, or some alternative to handle it inside
dhcpcd code?

Martin


Home | Main Index | Thread Index | Old Index