uboot和内核制作好后,下面要做的就是制作根文件系统。以前的做法把所有程序都写入到FLASH,于是不停的重复修改、编译、烧写,浪费了很多时间。其实最好的办法是只烧写uboot,在uboot下使用NFS加载内核,再通过设置内核参数的办法挂载NFS网络文件夹用作根目录。在确认最终版本后,再将内核和根文件系统写入FLASH。
uboot设置的参数如下:
bootdelay=1
baudrate=115200
ethaddr=00:50:50:50:50:01
ipaddr=192.168.0.220
serverip=192.168.0.12
netmask=255.255.255.0
ethact=w5300
bootcmd=nfs 0x22000000 /home/vmgong/nfsshare/uImage;bootm 0x22000000
bootargs=mem=64m console=ttyS0,115200 mac=00:50:60:50:60:01 root=/dev/nfs rw nfsroot=192.168.0.12:/nfs_fs ip=192.168.0.220:192.168.0.1:255.255.255.0:::eth0:off
stdin=serial
stdout=serial
stderr=serial
内核还需要加入必要的模块:
1. 选中Networking --->
Networking options --->
[*] IP: kernel level autoconfiguration
[*] IP: DHCP support
[*] IP: BOOTP support
[*] IP: RARP support
2. Device Drivers --->
Block devices --->
<*> Network block device support
3. 选中Device Drivers --->
Ethernet (10 or 100Mbit) --->
<*> Atmel MACB support
[*] Atmel MACB TX buffers in internal SRAM
4. 选中File systems --->
Network File Systems --->
<*> NFS file system support
[*] Provide NFSv3 client support
[*] Provide client support for the NFSv3 ACL protocol extension
[*] Provide NFSv4 client support (EXPERIMENTAL)
[*] Root file system on NFS
错误说明:
Root-NFS: Server returned error -13 while mounting /nfs_fs
说明NFS文件夹挂载失败,仔细检查NFS Server的设置。