NFS启动根文件系统失败,log显示 nfs: server not responding

按照 第三篇 6.6开发板使用NFS根文件系统
uboot设置:
uboot设置
=> setenv ipaddr 192.168.3.34
=> setenv serverip 192.168.3.51
=> ping 192.168.3.51
Using ethernet@020b4000 device
host 192.168.3.51 is alive

=> setenv nfsroot /home/book/nfs_rootfs
=> run netboot

kernel启动后 log显示ubuntu上的NFS server没有回应:
[ 4.860492] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 4.870033] Generic PHY 20b4000.ethernet-1:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=20b4000.ethernet-1:00, irq=-1)
[ 4.882393] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[ 6.935269] fec 20b4000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 6.954464] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 6.984634] Sending DHCP requests ., OK
[ 7.054275] IP-Config: Got DHCP answer from 192.168.3.1, my address is 192.168.3.34
[ 7.061982] IP-Config: Complete:
[ 7.065334] device=eth0, hwaddr=00:01:3f:2d:3e:4d, ipaddr=192.168.3.34, mask=255.255.255.0, gw=192.168.3.1
[ 7.075511] host=192.168.3.34, domain=, nis-domain=(none)
[ 7.081381] bootserver=0.0.0.0, rootserver=192.168.3.51, rootpath= nameserver0=192.168.3.1
[ 7.095652] ltemodule-pwr: disabling
[ 7.099292] wifi-pwr: disabling
[ 7.102466] ALSA device list:
[ 7.106091] #0: wm8960-audio
[ 7.151750] VFS: Mounted root (nfs filesystem) readonly on device 0:15.
[ 7.160543] devtmpfs: mounted
[ 7.166115] Freeing unused kernel memory: 1024K
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Starting 100ask lvgl: OK
[ 9.099312] ds18b20_drv_init OK.
[ 9.218258] dht11_drv_init OK.
[ 9.331739] irda_drv_init OK.
Populating /dev using udev: [ 9.668576] udevd[176]: starting version 3.2.9
[ 10.357301] udevd[177]: starting eudev-3.2.9
[ 11.737146] inv-mpu6000-spi spi2.0: mounting matrix not found: using identity…
[ 12.629001] 8723bu: loading out-of-tree module taints kernel.
[ 13.264729] usbcore: registered new interface driver rtl8723bu
done
Initializing random number generator: OK
Saving random seed: OK
Starting system message bus: done
Starting network: udhcpc: started, v1.31.1

[ 47.494423] random: crng init done
[ 64.534950] Bluetooth: hci0: Failed to load rtl_bt/rtl8723b_config.bin
[ 64.541567] Bluetooth: hci0: rtl: loading rtl_bt/rtl8723b_fw.bin
[ 202.774482] nfs: server 192.168.3.51 not responding, still trying
[ 202.780904] nfs: server 192.168.3.51 not responding, still trying
[ 202.787850] nfs: server 192.168.3.51 not responding, still trying
[ 228.374429] nfs: server 192.168.3.51 not responding, still trying
[ 244.544408] nfs: server 192.168.3.51 not responding, still trying

Ubuntu上测试本地挂载可以的:
book@100ask:~$ sudo mount -t nfs -o nolock localhost:/home/book/nfs_rootfs /mnt
[sudo] password for book:
book@100ask:~$
book@100ask:~$ ls /mnt
01_old boot etc lib32 media opt root run selinux tmp var
bin dev lib linuxrc mnt proc rootfs.tar.bz2 sbin sys usr

请大佬帮忙看看问题出在哪儿?

实际上经过我的测试发现是因为文件系统在执行init.d 内的脚本时候,启动了udhcpc 服务, 因为你的ubuntu 根本就没有安装dhcp 服务器, 所以会导致它一直卡住, 在刚上电的时候,是可以发现, 其他一直都是卡在Starting network: udhcpc: started, v1.31.1 这个地方, 后面的打印是其他线程执行的。在交互界面上,按键在串口上输入实际上是有输出的, 代表串口这个模块是正常运行的。结合网上其他的资料。怀疑是网络的问题。
后面将文件系统中/home/book/nfs_rootfs/etc/init.d/S40network这个脚本放到上一级目录,重启启动网络根文件系统, 就发现是可以进行登录了。

复现问题:
在这个S40network脚本中, 实际上会执行/sbin/ifup -a 这个命令,发现执行的结果和我们开始遇到的问题是一样的。
[root@100ask:~]# /sbin/ifup -a
udhcpc: started, v1.31.1

输出的打印也是类似的。
证明了就是这个问题了。 因为我们没有DHCP 服务器, 所以导致开发板无法正常分配IP 地址。

根据你说的修改,可以nfs正常启动了。