歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> Linux文化 >> 嵌入式linux下的tftp開發環境建立

嵌入式linux下的tftp開發環境建立

日期:2017/2/27 11:56:36   编辑:Linux文化

TFTP是用來下載遠程文件的最簡單網絡協議,它其於UDP協議而實現。嵌入式linux的tftp開發環境包括兩個方面:一是linux服務器端的tftp-server支持,二是嵌入式目標系統的tftp-client支持。因為u-boot本身內置支持tftp-client,所以嵌入式目標系統端就不用配置了。下面就詳細介紹一下linux服務器端tftp-server的配置。

在redhat 9.0的第三張光盤中,有tftp-server的安裝rpm包。

(1)安裝

#mount –t iso9660 /dev/hdc /mnt/cdrom //掛載光盤

#rpm -ivh tftp-server-0.32-4.i386.rpm //安裝

#umount /mnt/cdrom //卸載光盤

(2)修改文件

在linux下,不管使用的是哪一種super-server,inetd或者xinetd,默認情況下TFTP服務是禁用的,所以要修改文件來開啟服務。

根據(1)的安裝方法,可以修改文件/etc/xinetd.d/tftp。主要是設置TFTP服務器的根目錄,開啟服務。修改後的文件如下:

service tftp { socket_type =dgram protocol =udp wait =yes user =root server =/usr/sbin/in.tftpd server_args =-s /home/lqm/tftpboot -c disable =no per_source =11 cps =100 2 flags =IPv4 }

說明:修改項server_args= -s -c,其中處可以改為你的tftp-server的根目錄,參數-s指定chroot,-c指定了可以創建文件。

(3)創建tftp根目錄,啟動tftp-server

#mkdir /home/lqm/tftpboot #chmod o+w /home/lqm/tftpboot #service xinetd restart 這樣,tftp-server就啟動了。你可以登陸本機測試以下,命令如下: #tftp your-ip-address tftp>get tftp>put tftp>q #

Copyright © Linux教程網 All Rights Reserved