tftp配置

这篇文章里tftp的设置是有问题的,请参考我另外一个文章

http://blog.csdn.net/hnmsky/article/details/6398616



因为要搞2440的开发板,所以搞了一下tftp。

安装软件

sudo apt-get install tftp tftpd 。

sudo apt-get install tftpd tftp openbsd-inetd

因为ubuntu默认是安装openbsd-inetd,所以我装了这个。结果代价就是搞了一晚上。

不知为何,网上找的openbsd-inetd配置无效,所以最后用的是xinetd的配置。

 

以下参考http://forum.ubuntu.org.cn/viewtopic.php?f=97&t=259975

sudo apt-get install xinetd tftpd-hpa tftp-hpa

 

2、xinetd会建立目录/etc/xinetd.d/,在这个目录下建立新文件 tftpd
代码:
sudo touch tftpd


3、编辑 sudo gedit /etc/xinetd.d/tftpd,加入以下内容
代码:
service tftp
      {
                 disable = no
                 socket_type = dgram
                 wait = no
                 user = root/etc/xinetd.d/tftpd
                 protocol = udp
                 server = /usr/sbin/in.tftpd
                 server_args = -s /home/tftpd
                 log_on_success = PID HOST DURATION
                 log_on_failure = HOST
       }

注意:/home/tftpd 是你的tftp的根目录,其它的不用修改

4、建立tftp根目录
代码:
sudo mkdir /home/tftpd

修改权限
代码:
sudo chmod 777 /home/tftpd


5、修改/etc/inetd.conf文件
代码:
sudo gedit /etc/inetd.conf

修改下面这行
代码:
tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot


代码:
tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /home/tftpd

6、修改/etc/default/tftpd-hpa
代码:
sudo gedit /etc/default/tftpd-hpa

内容修改如下
代码:
#Defaults for tftpd-hpa
      RUN_DAEMON="yes"
      OPTIONS="-l -s /home/tftpd"


7、重启服务
代码:
sudo /etc/init.d/xinetd restart
      sudo /etc/init.d/tftpd-hpa restart


8、不要忘记修改/home/tftpd 下文件的权限
代码:
chmod 777 *


开发板上tftp命令 : tftp 30000000 uImage

部分为转载

 

 

 

虽然我是用cramfs,但把tmp 作为了ramfs ,可以用tftp接收文件,这下省的每次得都重新编译文件系统

tftp 在linux下的用法感觉没有 在u-boot下面好用

下面是busybox里面的解释

Usage: tftp [OPTION]... HOST [PORT]

Transfer a file from/to tftp server using "octet" mode

Options:
        -l FILE Local FILE
        -r FILE Remote FILE
        -g      Get file
        -p      Put file
        -b SIZE Transfer blocks of SIZE octets

 

进入可以读写的tmp目录,执行

/tmp # tftp -g -r uimage 192.168.0.1

就可以收到了uimage文件

说不定还能帮我传yaffs文件哦???

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值