I am trying to nfs-boot a linux managed with systemd, via tftp kernel + nfs rootfs, my bootargs:
root=/dev/nfs rw nfsroot=192.168.0.10:/nfsroot/rootfs,nolock ip=192.168.0.60:192.168.0.10:192.168.0.10:255.255.255.0
Both kernel and rootfs loads successfully and the system is running, until
systemd-networkd starts. After that, I can not ping the machine and NFS mount hangs (obviously).
I tried to add network config for
systemd-networkd to initialize the network, but it does not work.
The serial console log:
Starting Network Service... ... [ OK ] Started Network Service. [ OK ] Reached target Network. ... [ * 39.330000] nfs: server 192.168.0.10 not responding, still trying
The network config:
[Match] Name=eth0 [Network] Address=192.168.0.60/24 Gateway=192.168.0.10 [Route] Gateway=192.168.0.10 Destination=192.168.0.0
I wonder why
systemd-networkd.service breaks the network when the system is started via nfs?
I guess when
networkd starts, it withdraws the ip address, and then tries to read the config file. At this time the nfs mount already breaks, and it does not have a chance to read the config file.
If my guess is true, how to "fix" or "workaround" this issue?