ubuntu12.04 搭建TFTP,NFS,Minicom 环境
2014-05-08 19:55
337 查看
ubuntu 12.04 嵌入式环境搭建 (Minicom ,NFS,TFTP)
0. 安装minicom:
$sudo apt-get install minicom
配置minicom:配置:
$sudo minicom -s
Serial port setup
| A - Serial Device : /dev/ttyS0 或 /dev/ttyUSB0
|
| B - Lockfile Location : /var/lock |
| C - Callin Program : |
| D - Callout Program : |
| E - Bps/Par/Bits : 115200 8N1 |
| F - Hardware Flow Control : No |
| G - Software Flow Control : No |
| |
| Change which setting? |
Save setup as dfl
Exit from Minicom
启动:
minicom
1.安装NFS
nfs原理是通过网络,将远程主机共享的文件系统,挂载到本机。Ubuntu 12.04上默认是没有安装NFS服务器的,首先要安装NFS服务程序:
$
sudo apt-get install nfs-kernel-server
(安装nfs-kernel-server时,apt会自动安装nfs-common和portmap) 这样,宿主机就相当于NFS Server。
创建主机nfs共享目录:
$sudo mkdir /nfs_root
$cd /nfs_root
$sudo touch hello.txt
$sudo vim hello.txt
输入hellonfs!
2 宿主机NFS的配置
2.1 修改配置文件/etc/exports
在终端下用 $ sudo vim /etc/exports打开exports文件。
如果你没有配置过这个文件的话此文件应该是空的。
在开始部分写入 /nfs_root * (rw,sync,no_root_squash)
/nfs_root是你的nfs主机共享目录
OK,保存,退出。
修改完成之后输入:# exportfs –rv来使配置文件生效
2.2 配置宿主机的IP
配置宿主机的IP,在命令行中输入 # ifconfig 来查看本机的IP地址。如果没有设置,
可以用命令 $sudo ifconfig eth0 192.168.0.231 来设置IP。其中的IP地址可以根据具体情况来设定,
建议和你的开发板ip为同一个网段,我开发板ip是192.168.0.232那主机ip可以是192.168.0.231
设定完成后再通过查看ifconfig eth0信息来确认
2.3 启动宿主机NFS服务
安装完NFS服务后就可以通过 $sudo /etc/init.d/nfs-kernel-server restart来重新开启网络文件系统服务,以便后面的开发板挂载。也可以通过$sudo /etc/init.d/nfs-kernel-server stop来停止。
3 目标板的挂载操作
目标机上电,目标板上的Linux操作系统起来以后,在PC机上Ubuntu操作系统上打开minicom,通过串口向目 标板发送shell命令。
像主机操作一样,首先检查目标板(宿主机)的IP是否与宿主机的IP再同一个地址段上,否则用上面用过的命令 进行检查和设置本地IP。
设置完IP之后可以ping一下检查网卡、网线是否连接正确。
既在主机shell中输入# ping 192.168.0.232 (开发板ip)连接成功会不断的打印信息。
接下来就是在开发板上进行挂载mount,
启动minicom
$sudo minicom
# mount -onolock 192.168.0.231:/nfs_root /mnt
#cd mnt
#cp hello.txt /
#cd
#cat hello.txt
hellonfs!
其中:/nfsroot
是 宿主机的nfs共享目录; /mnt是开发板的挂载目录
通过# cd /mnt
# ls
可以发现主机的/nfs_root目录被挂载进了开发板mnt目录中。这样就可以方便在宿主机和开发版之间文件 传输和共享了。
如果你想取消挂在可以使用命令# umount /mnt就可以了
ubuntu12.04搭建tftp服务器
(1) $ sudo apt-get install tftpd tftp openbsd-inetd
(2) $ sudo vim /etc/inetd.conf
在这个配置文件里面找到下面的位置:
#:BOOT: TFTP service is provided primarily for booting. Most sites
# run this only on machines acting as "boot servers."
#tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /srv/tftp
#我把上面的默认的配置文件用井号注释掉了,自己配置了tftp的主工作目录为/tftp
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftp
(3):wq 保存文件退出。
(4)创建TFTP服务器的文件目录。
$cd /
$sudo mkdir tftp
$ sudo chmod 777 /tftp
如果有需要下载的文件这时可以拷贝进去,也用chmod 777命令把所有权限打开。
(5)启动(或重启)xinetd服务
$sudo /etc/init.d/openbsd-inetd restart
(7)在本机测试一下:
a.在/tftp目下新建一个文件,并写入数据:
$:/tftp$ echo helloworld > hello
$:/tftp$ cat hello
$:helloworld
b. 到/home目录下
$:/home$ sudo tftp 221.204.110.99
tftp> get hello
Received 12 bytes in 0.0 seconds
tftp> quit
$:/home$ cat hello
helloworld
$:/home$
行了,本地测试成功!
二、在开发板上使用tftp
cd到任意一个目录
# tftp -g -r hello 192.168.0.231
# ls
# hello
0. 安装minicom:
$sudo apt-get install minicom
配置minicom:配置:
$sudo minicom -s
Serial port setup
| A - Serial Device : /dev/ttyS0 或 /dev/ttyUSB0
|
| B - Lockfile Location : /var/lock |
| C - Callin Program : |
| D - Callout Program : |
| E - Bps/Par/Bits : 115200 8N1 |
| F - Hardware Flow Control : No |
| G - Software Flow Control : No |
| |
| Change which setting? |
Save setup as dfl
Exit from Minicom
启动:
minicom
1.安装NFS
nfs原理是通过网络,将远程主机共享的文件系统,挂载到本机。Ubuntu 12.04上默认是没有安装NFS服务器的,首先要安装NFS服务程序:
$
sudo apt-get install nfs-kernel-server
(安装nfs-kernel-server时,apt会自动安装nfs-common和portmap) 这样,宿主机就相当于NFS Server。
创建主机nfs共享目录:
$sudo mkdir /nfs_root
$cd /nfs_root
$sudo touch hello.txt
$sudo vim hello.txt
输入hellonfs!
2 宿主机NFS的配置
2.1 修改配置文件/etc/exports
在终端下用 $ sudo vim /etc/exports打开exports文件。
如果你没有配置过这个文件的话此文件应该是空的。
在开始部分写入 /nfs_root * (rw,sync,no_root_squash)
/nfs_root是你的nfs主机共享目录
OK,保存,退出。
修改完成之后输入:# exportfs –rv来使配置文件生效
2.2 配置宿主机的IP
配置宿主机的IP,在命令行中输入 # ifconfig 来查看本机的IP地址。如果没有设置,
可以用命令 $sudo ifconfig eth0 192.168.0.231 来设置IP。其中的IP地址可以根据具体情况来设定,
建议和你的开发板ip为同一个网段,我开发板ip是192.168.0.232那主机ip可以是192.168.0.231
设定完成后再通过查看ifconfig eth0信息来确认
2.3 启动宿主机NFS服务
安装完NFS服务后就可以通过 $sudo /etc/init.d/nfs-kernel-server restart来重新开启网络文件系统服务,以便后面的开发板挂载。也可以通过$sudo /etc/init.d/nfs-kernel-server stop来停止。
3 目标板的挂载操作
目标机上电,目标板上的Linux操作系统起来以后,在PC机上Ubuntu操作系统上打开minicom,通过串口向目 标板发送shell命令。
像主机操作一样,首先检查目标板(宿主机)的IP是否与宿主机的IP再同一个地址段上,否则用上面用过的命令 进行检查和设置本地IP。
设置完IP之后可以ping一下检查网卡、网线是否连接正确。
既在主机shell中输入# ping 192.168.0.232 (开发板ip)连接成功会不断的打印信息。
接下来就是在开发板上进行挂载mount,
启动minicom
$sudo minicom
# mount -onolock 192.168.0.231:/nfs_root /mnt
#cd mnt
#cp hello.txt /
#cd
#cat hello.txt
hellonfs!
其中:/nfsroot
是 宿主机的nfs共享目录; /mnt是开发板的挂载目录
通过# cd /mnt
# ls
可以发现主机的/nfs_root目录被挂载进了开发板mnt目录中。这样就可以方便在宿主机和开发版之间文件 传输和共享了。
如果你想取消挂在可以使用命令# umount /mnt就可以了
ubuntu12.04搭建tftp服务器
(1) $ sudo apt-get install tftpd tftp openbsd-inetd
(2) $ sudo vim /etc/inetd.conf
在这个配置文件里面找到下面的位置:
#:BOOT: TFTP service is provided primarily for booting. Most sites
# run this only on machines acting as "boot servers."
#tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /srv/tftp
#我把上面的默认的配置文件用井号注释掉了,自己配置了tftp的主工作目录为/tftp
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftp
(3):wq 保存文件退出。
(4)创建TFTP服务器的文件目录。
$cd /
$sudo mkdir tftp
$ sudo chmod 777 /tftp
如果有需要下载的文件这时可以拷贝进去,也用chmod 777命令把所有权限打开。
(5)启动(或重启)xinetd服务
$sudo /etc/init.d/openbsd-inetd restart
(7)在本机测试一下:
a.在/tftp目下新建一个文件,并写入数据:
$:/tftp$ echo helloworld > hello
$:/tftp$ cat hello
$:helloworld
b. 到/home目录下
$:/home$ sudo tftp 221.204.110.99
tftp> get hello
Received 12 bytes in 0.0 seconds
tftp> quit
$:/home$ cat hello
helloworld
$:/home$
行了,本地测试成功!
二、在开发板上使用tftp
cd到任意一个目录
# tftp -g -r hello 192.168.0.231
# ls
# hello
相关文章推荐
- Ubuntu12.04 android开发环境搭建(配置minicom TFTP NFS java版本切换)
- 嵌入式软件开发培训笔记——ARM架构Linux系统下交叉编译环境搭建、NFS、TFTP服务配置及Nandflash的读写
- 虚拟机开发环境搭建(tftp,nfs,samba,arm-linux-gcc)
- linux之编程环境搭建步骤--nfs/tftp/svn/boost/dnw/samba
- E9天嵌i.mx6q的nfs和tftp环境搭建
- mini6410基于linux2.6.36内核通过NFS启动根文件系统总结(一搭建开发环境——建立tftp服务器)
- centos + nfs + tftp + bcompare + vim + cscope + ctags + tlist--- Linux基础开发环境搭建小记
- ubuntu12.04环境配置-远程登录+互传文件+tftp和nfs
- NFS&TFTP--VMWARE下UBUNTU,搭建交叉编译环境。
- E9天嵌i.mx6q的nfs和tftp环境搭建
- Ubuntu10.04中minicom、Centos5中NFS环境搭建详解
- MPSOC之9——host、embeded间tftp、nfs、ftp环境搭建
- Ubuntu12.04搭建tftp&nfs服务器
- [3]_嵌入式开发环境搭建1_在ubuntu16.04.3 安装配置nfs 和 tftp服务器
- 关于嵌入式linux开发环境搭建-TFTP,SAMBA,NFS服务器的搭建
- ARM与Linux_PC之间tftp通信环境的搭建
- ubuntu12.04搭建android编译环境
- ubuntu下搭建nfs,tftp,安装qt等一些基本的启动bootloader前的服务
- ubuntu 10.04下的tftp/nfs服务器搭建
- ubuntu NFS环境的搭建