开发过程中一般会选择NFS文件系统,因为不需要频繁的烧写flash,NFS配置如下:
1、安装(命令),一般来说,系统是默认安装了NFS的,如果没有安装可通过下列命令安装,NFS需要两个软件包
yum install nfs-utils-*
yum install portmap*
2、配置:在/etc/exports文件中增加如下一行
/home/linux/nfsboot *(rw,sync,no_root_squash)
其中/home/linux/nfsboot/是nfs文件系统所在的目录,即解压根文件系统的目录
3、启动nfs服务器(命令)
/etc/init.d/nfs start
mount -t nfs localhost:/home/linux/nfsboot /mnt/
如果成功则会在/mnt目录看到和/home/linux/nfsboot内一样的内容
5、如果是uboot则可以在uboot中通过如下命令设置uboot的环境变量引导linux,并挂载nfs文件系统
set bootargs noinitrd root=/dev/nfs rw nfsroot=192.168.1.1:/home/linux/nfsboot ip=192.168.1.2:192.168.1.1:255.255.255.0 console=ttySAC0
其中开发机的ip为192.168.1.1,开发板的ip为192.168.1.2