Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2372136
  • 博文数量: 298
  • 博客积分: 7876
  • 博客等级: 准将
  • 技术积分: 5500
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-23 13:39
文章存档

2013年(2)

2012年(142)

2011年(154)

分类: LINUX

2011-04-12 12:21:13

:

虚拟机系统:Red Hat Enterprise Linux 5

Linux内核版本:2.6.18-194.e5

的概述

在嵌入式开发过程中有宿主机和目标机的角色之分:宿主机是执行编译、链接嵌入式软件的计算机,目标机是运行嵌入式软件的硬件平台。Tftp服务器作为工作于宿主机上的软件,主要提供对目标机的主要映像文件的下载工作。

 

1.2 tftp安装测试

1.2.1 使用RPM包安装tftp-server

利用下面的命令查看服务器是否已经启动,如果已经安装则不用安装

netstat –a | grep tftp

已安装结果: udp 00 *:tftp *:*

如果没有安装则执行

 #rpm  -ivh  tftp-0.42-3.1.i386.rpm         //安装tftp-client 注意要安装了客户端才有tftp命令
 #rpm  -ivh  tftp-server-0.42-3.1.i386.rpm         //安装tftp-server

 

1.2.2建立tftp主工作目录

mkdir /tftpboot

注意:权限问题 chmod 777 /tftpboot

1.2.3修改配置文件

vi /etc/xinetd.d/tftp

# default: off

# description: The tftp server serves files using the trivial file transfer \

#   protocol.  The tftp protocol is often used to boot diskless \

#   workstations, download configuration files to network-aware printers, \

#   and to start the installation process for some operating systems.

service tftp

{

    disable = no

    socket_type     = dgram

    protocol        = udp

    wait            = yes

    user            = root

    server          = /usr/sbin/in.tftpd

    server_args     = -s /tftpboot c 工作目录

    per_source      = 11

    cps         = 100 2

    flags           = IPv4

}

 

1.2.4 重启服务

/etc/init.d/xinetd restart

netstat –a | grep tftp

udp 00 *:tftp *:*

 

1.2.5测试服务

修改客户机的IP跟主机在同一个网段
    ifconfig eth0 192.168.1.30

tftp> put 1.txt

tftp> get 1.txt

 

安装过程中出现的问题及原因
现象一:
tftp> get test.log
Transfer timed out.
原因:
tftpd
服务没有启动


现象二:
tftp> get test.log
Error code 2: Only absolute filenames allowed
原因:
/etc/xinetd.d/tftpd中设置的server_args/etc/default/tftpd-hpa
cat /etc/default/tftpd-hpa
#Defaults for tftpd-hpa
RUN_DAEMON="no"
OPTIONS="-s /home/tftpd -c -p -U 077 -u tftpd"
设置的时候只要将server_args=改为你自己设定的服务器文件夹就行了


现象三:
tftp> put ex070416.log
Error code 1: File not found
原因:
指定的文件不存在;或tftpd启动参数中没有指定-c选项,允许上传文件。

 

现象四:

tftp> get test.log

Error code 1: File not found

原因:

指定文件的权限不够,使用chmod 777

阅读(4381) | 评论(0) | 转发(1) |
0

上一篇:linux软件安装

下一篇:db_load命令不存在

给主人留下些什么吧!~~