嵌入式Linux中tftp和nfs的笔记
来源:互联网 发布:萨尔 知乎 编辑:程序博客网 时间:2024/05/16 04:41
一、tftp
我用的ubuntu14.04已经安装好tftp服务,这里记录下网上的安装方法:
1、服务器安装tftp,
apt-get install tftpd-hpa, tftp-hpa
我没有安装xinetd,能够成功从服务器下载文件到开发板。
2、配置TFTP服务器:
# /etc/default/tftpd-hpaTFTP_USERNAME="tftp"TFTP_DIRECTORY="/root/hi3518/tftpboot" #服务器端的tftp目录TFTP_ADDRESS="0.0.0.0:69"#TFTP_OPTIONS="--secure" TFTP_OPTIONS="-l -c -s"
3、重启tftp服务service tftpd-hpa restart
看看服务是否开启
netstat -a | grep tftp
显示结果为
udp 0 0 :tftp :*
表明服务已经开启,就表明tftp配置成功了。
4、在服务器端测试tftp:
tftp
get “filename”
但我这步没有成功。
下面是在开发板上测试tftp
“需要注意的的是设置开发板的serverip与服务器的ip设置一样”
“关闭防火墙”
“开发板在编译内核时应该把tftp选中,编译进内核中”
1、在开发板进入Linux系统后,busybox中的tftp命令为:
# tftpBusyBox v1.16.1 (2015-04-01 19:35:12 HKT) multi-call binary.Usage: tftp [OPTIONS] HOST [PORT]Transfer a file from/to tftp serverOptions: -l FILE Local FILE (本地文件) -r FILE Remote FILE (远程服务器上tftp目录下的文件) -g Get file (下载文件) -p Put file (上传文件到服务器) -b SIZE Transfer blocks of SIZE octets#
2、下载文件到当前目录tftp -g -r
# lshello hello.c world.c# rm hello # lshello.c world.c# rm hello.c# rm world.c# ls# tftp -g -r hello.c 192.168.1.105hello.c 100% |**************************| 512 --:--:-- ETA# cat hello.c#include<stdio.h>main(){ printf("hello\r\n");}# tftp -g -r hello 192.168.1.105hello 100% |*************************| 5120 --:--:-- ETA# ./hello-sh: ./hello: Permission denied# ls -l hello-rw-r--r-- 1 root root 4681 Jan 1 00:13 hello# chmod 777 hello# ./hellohello#
3、uboot中也带有tftp服务,其命令格式与busybox中的不一样
在uboot命令下tftp下载服务器文件到ram中的确定的地址
mw.b 82000000 ff 100000 (擦除一定空间大小)
tftp 0x82000000 (下载文件到此地址中)
这样可方便的下载编译好的内核和文件系统,如果在Windows系统下用tftp需要tftpd32软件,把在Linux系统中编译好的文件复制到Windows下,比较麻烦。
二、nfs
1、服务器端nfs的配置,网上很多
配置文件:etc目录下的exports文件,最后面添加下面一句:
/root/hi3518/nfs *(insecure,rw,sync,no_root_squash)
前面的目录自己设置,*表示所有ip都可以访问这个目录,若要指定Ip可以这样写
/root/hi3518/nfs 192.168.1.*(insecure,rw,sync,no_root_squash)
开启nfs
/etc/init.d/portmap start //用service portmap stasrt也可以
/etc/init.d/nfs start 或者service nfs start也可以
nfs挂载有两种,一是把服务器端的完整的文件系统作为开发板的跟文件系统挂载,
参考嵌入式linux之NFS启动根文件系统
二是把服务器nfs目录挂载在开发板上的一个目录上。
linux nfs配置
# lsnfs tftp# cd nfs# cd ..# mount -t nfs -o nolock 192.168.1.105:/root/hi3518/nfs nfs# cd nfs# lshello hello.c ircut ko redled sample_venc# cd ..# lsnfs tftp# umount -t nfs 192.168.1.105:/root/hi3518/nfsumount: can't umount 192.168.1.105:/root/hi3518/nfs: No such file or directory# lsnfs tftp# cd nfs# ls#
- 嵌入式Linux中tftp和nfs的笔记
- linux 配置tftp和nfs
- 在LINUX中建立NFS和TFTP应注意的几个问题
- TFTP和NFS 的配置
- linux下tftp、samba、nfs服务的配置和启用
- linux下配置TFTP和NFS服务的方法
- 嵌入式Linux的NFS
- 关于嵌入式linux开发环境搭建-TFTP,SAMBA,NFS服务器的搭建
- 嵌入式软件开发培训笔记——ARM架构Linux系统下交叉编译环境搭建、NFS、TFTP服务配置及Nandflash的读写
- Linux下tftp和nfs配置
- 嵌入式笔记-----------LInux根文件系统的制作和nfs挂载制作好的根文件系统
- tftp和nfs服务的建立(转
- tftp和nfs服务的建立
- tftp和NFS服务器的建立
- ubuntu配置tftp和nfs的方法
- 安装tftp和nfs
- nfs 和 tftp
- nfs和tftp概要
- 使用 Office 365 PowerShell 管理用户帐户和许可证(二)使用 Office 365 PowerShell 查看授权和未授权的用户
- rex run 传参
- 38. Count and Say(第十二周)
- 海航集团王健出席海南省脱贫攻坚暨扶贫日主题晚会
- Android之蓝牙开发初编(发现蓝牙,配对蓝牙,连接蓝牙)
- 嵌入式Linux中tftp和nfs的笔记
- CoInitializeEx function
- Python: PS 滤镜--扇形变换
- Linux设备树的用法
- 查询行业数据报告
- SQL Server触发器及其操作语句
- 海航集团王健随同罗保铭书记出访加拿大和美国
- 双向循环型多链接链表
- 16-17年度工作总结