==缺点:不能传文件夹,没有NFS方便==
通过tftp、nfs、ftp等方式,实现开发板linux与host高效交换文件。
windows/ubuntu/开发板三者能ping通。
ubuntu作为服务器,开发板作为客户端,共享数据。 windows也可以作为客户端,不过现在VMware共享数据很方便,没有这个必要了。
安装
sudo apt-get install tftpd-hpa sudo apt-get install tftp-hpa配置
sudo vim /etc/default/tftpd-hpa sudo service tftpd-hpa restart ps -A | grep "tftp*" 显示:37921 ? 00:00:00 in.tftpd修改后的/etc/default/tftpd-hpa文件,修改了目录和TFTP_OPTIONS,注意该目录的权限
# /etc/default/tftpd-hpa TFTP_USERNAME="tftp" TFTP_DIRECTORY="/home/liuwanpeng/work/tftpboot" TFTP_ADDRESS=":69" TFTP_OPTIONS="-l -c -s"关于TFTP_OPTIONS的几个有用配置:
man tftpd -l, --listen Run the server in standalone (listen) mode, rather than run from inetd. In listen mode, the --timeout option is ignored, and the --address option can be used to specify a specific local address or port to listen to. --create, -c Allow new files to be created. By default, tftpd will only allow upload of files that already exist. Files are created with default permissions allowing anyone to read or write them, unless the --permissive or --umask options are specified. --secure, -s Change root directory on startup. This means the remote host does not need to pass along the directory as part of the trans‐ fer, and may add security. When --secure is specified, exactly one directory should be specified on the command line. The use of this option is recommended for security as well as compati‐ bility with some boot ROMs which cannot be easily made to include a directory name in its request.开发板busy box默认安装的是tftpd客户端,不再专门安装-hpa。
开发板输入tftp,查看帮助
root@xilinx-zcu102-2017_2:~# tftp BusyBox v1.24.1 (2017-06-19 21:24:47 MDT) multi-call binary. Usage: tftp [OPTIONS] HOST [PORT] Transfer a file from/to tftp server -l FILE Local FILE -r FILE Remote FILE -g Get file -p Put file从主机的tftpboot目录下读取Makefile文件,保存到本地,名字不变。没有-l参数,同名保存。 存到哪了?==默认保存到当前目录==
tftp -l Makefile -r Makefile -g 192.168.1.200 tftp -r Makefile -g 192.168.1.200 tftp -l Makefile -p 192.168.1.200==tftp: server error: (1) File not found:==
服务器端没有开启上传权限
root@xilinx-zcu102-2017_2:~/test# tftp -l Makefile -p 192.168.1.200 tftp: server error: (1) File not found通过tftp、nfs、ftp等方式,实现开发板linux与host高效交换文件。
windows/ubuntu/开发板三者能ping通。
安装后会生成配置文件
sudo gedit /etc/exports增加一行配置,文件如下:
sudo cat /etc/exports # /etc/exports: the access control list for filesystems which may be exported # to NFS clients. See exports(5). # # Example for NFSv2 and NFSv3: # /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check) # # Example for NFSv4: # /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check) # /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check) # /home/liuwanpeng/work/share 192.168.1.*(rw,sync,no_root_squash)重启nfs服务
sudo /etc/init.d/nfs-kernel-server restart开发板只需mount就可以了
mount -n -o nolock 192.168.1.200:/home/liuwanpeng/work/share/ /mnt/ 参数说明: -n, --no-mtab don't write to /etc/mtab转载于:https://www.cnblogs.com/liuwanpeng/p/8074451.html
相关资源:SDSoC硬件平台搭建 zynq mpsoc