一、tftp服务搭建
1."sudo apt-get install xinetd" 安装xinetd,安装完成xinetd后,接下来安装tftp和tftpd,输入命令:“sudo apt-get install tftp tftpd”.
然后建立TFTP配置文件,使用命令:"vi /etc/xinetd.d/tftp"建立文件,向文件中写入如下代码(必须按照格式严格对齐):
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot //指定tftp下载路径
disable = no
}
2.重启xinetd服务。输入命令:“sudo /etc/init.d/xinetd restart”.到这里,TFTP服务器就搭建好了。
3.在宿主机上执行“tftp 127.0.0.1”,
root@jun-R439-R478:/opt/EmbedSky/TQ210/rootfs/etc/init.d# tftp 127.0.0.1
tftp> get a.txt
tftp->q
二、nfs挂载文件系统
1.linux内核配置支持nfs文件系统
2.sudo apt-get install nfs-kernel-server安装nfs-server
3.vi /etc/exprots
/opt/EmbedSky/TQ210/rootfs 192.168.1.*()接收1网段的所有链接
4..mount -t nfs 192.168.1.8:/opt/rootfs /mnt ,查看 /mnt下面是否挂载成功,如果成功,则说明nfs服务搭建ok
三、配置开发板启动参数
1.修改内核加载方式
bootcmd=tftp c0008000 zImage;bootm c0008000
2.修改bootargs
bootargs = 'noinitrd init=/init console=ttySAC0 root=/dev/nfs rootwait=1 nfsroot=192.168.1.200:/opt/EmbedSky/TQ210/rootfs ip=192.168.1.6:192.168.1.200:192.168.1.6:255.255.255.0:www.embedsky.com:eth0:off'
四、遇到的问题
1.使用NFS挂载时,卡在server 192.168.1.200 not responding,still trying
解决办法:注释掉NFS文件系统下的etc/init.d/rcS中,#net_set &即可。