linux內核掛載nfs文件系統
1、配置網絡部分,主要是使能CONFIG_IP_PNP以在2中能夠看到Root file system on NFS選項
Networking support
Networking options
TCP/IP networking
IP: kernel level autoconfiguration
[*] IP: DHCP support
[*] IP: BOOTP support
2、配置開啓nfs服務
File systems --->
Network File Systems --->
<*> NFS client support
[*] NFS client support for NFS version 3
[*] NFS client support for the NFSv3 ACL protocol extension
[*] NFS client support for NFS version 4 (EXPERIMENTAL)
[*] NFS client support for NFSv4.1 (DEVELOPER ONLY)
[*] Root file system on NFS
3.make uImage
4、在uboot中設置如下啓動參數(IP根據實際使用更改)
setenv bootargs init=/linuxrc console=ttySAC0 bootdelay=10 root=/dev/nfs rw nfsroot=192.168.1.100:/opt/EmbedSky/nfs_root,v3,tcp ip=192.168.1.103:192.168.1.100:192.168.1.1:255.255.255.0::eth0:off
5內核打印命令行檢查參數設置是否正確
Kernel command line: console=ttySAC0,115200 init=/init video=mxcfb0:dev=lcd,CLAA-WVGA,if=RGB24,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=48M vmalloc=400M androidboot.console=ttySAC0 androidboot.hardware=freescale root=/dev/nfs ip=192.168.1.103 fec_mac=12:32:43:34:21:43 nfsroot=192.168.1.100:/opt/EmbedSky/nfs_root,v3,tcp
6檢查/opt/EmbedSky/nfs_root/etc/init.d/rcS,去掉網卡操作相關的指令rcS
#ifconfig lo 127.0.0.1
#net_set &
7.掛載成功