日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

TFTP服务器的搭建与使用

發(fā)布時間:2024/8/1 52 豆豆
生活随笔 收集整理的這篇文章主要介紹了 TFTP服务器的搭建与使用 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

TFTP 服務(wù)器搭建

1.更新源

因為開發(fā)環(huán)境版本較低,已經(jīng)不支持tftp包安裝,所以要更新一下源
打開sources.list 文檔

gedit /etc/apt/sources.list 將下面的內(nèi)容覆蓋住原來的內(nèi)容 deb http://old-releases.ubuntu.com/ubuntu/ precise main restricted deb-src http://old-releases.ubuntu.com/ubuntu/ precise main restricted deb http://old-releases.ubuntu.com/ubuntu/ precise-updates main restricted deb-src http://old-releases.ubuntu.com/ubuntu/ precise-updates main restricted deb http://old-releases.ubuntu.com/ubuntu/ precise universe deb-src http://old-releases.ubuntu.com/ubuntu/ precise universe deb http://old-releases.ubuntu.com/ubuntu/ precise-updates universe deb-src http://old-releases.ubuntu.com/ubuntu/ precise-updates universe deb http://old-releases.ubuntu.com/ubuntu/ precise multiverse deb-src http://old-releases.ubuntu.com/ubuntu/ precise multiverse deb http://old-releases.ubuntu.com/ubuntu/ precise-updates multiverse deb-src http://old-releases.ubuntu.com/ubuntu/ precise-updates multiverse deb http://old-releases.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse deb-src http://old-releases.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse deb http://old-releases.ubuntu.com/ubuntu/ precise-security main restricted deb-src http://old-releases.ubuntu.com/ubuntu/ precise-security main restricted deb http://old-releases.ubuntu.com/ubuntu/ precise-security universe deb-src http://old-releases.ubuntu.com/ubuntu/ precise-security universe deb http://old-releases.ubuntu.com/ubuntu/ precise-security multiverse deb-src http://old-releases.ubuntu.com/ubuntu/ precise-security multiverse deb http://old-releases.ubuntu.com/ubuntu/ precise main deb-src http://old-releases.ubuntu.com/ubuntu/ precise main 保存退出 sudo apt-get update //更新源

各大鏡像站
華為的:https://repo.huaweicloud.com/java/jdk/
清華(只有adoptopenjdk鏡像):https://mirrors.tuna.tsinghua.edu.cn/AdoptOpenJDK/
aws jdk:https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html
阿里鏡像站(只有l(wèi)inux的):https://developer.aliyun.com/mirror/
阿里drangonwell: https://cn.aliyun.com/product/dragonwell

2.安裝Tftp服務(wù)端,客戶端和守護進程

安裝:

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

之后,在根目錄下建一個 tftpboot,并把屬性改成任意用戶可讀寫:
cd /

sudo mkdir tftpboot sudo chmod 777 tftpboot

然后,進入目錄 /etc/xinetd.d/,并在其中新建文件 tftp,把指定的內(nèi)容加入到 tftp 文件中: cd /etc/xinetd.d/

sudo vim tftp

添加以下內(nèi)容到 tftp 文件

service tftp { disable = no 138 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 }

最后,修改配置文件/etc/default/tftpd-hpa,修改為

TFTP_USERNAME="tftp" TFTP_DIRECTORY="/tftpboot" TFTP_ADDRESS="0.0.0.0:69" TFTP_OPTIONS="--secure -l -c -s"

注意:將”TFTP_DIRECTORY“改為新建tftpboot目錄所在的路徑。

3.重新啟動服務(wù)

#sudo /etc/init.d/xinetd reload #sudo /etc/init.d/xinetd restart #sudo /etc/init.d/tftpd-hpa restart reload xinetd xinetd -restart service tftpd-hpa restart

4.測試服務(wù)器

測試一下,在/tftpboot文件夾下新建立一個文件

touch abc

進入另外一個文件夾

tftp 192.168.2.51 (192.168.2.51 為本機 IP) tftp> get abc


然后按Ctrl+z退出,如果可以下載說明服務(wù)器已經(jīng)安裝成功,將開發(fā)板同 PC 通過網(wǎng)線進行連接后即可使用 tftp 下載文件,如果下載失敗,請稍后嘗試或者重新啟動服務(wù)器。

5.Uboot 使用 tftp

  • 用網(wǎng)線連接主機和開發(fā)板的網(wǎng)口并將編譯好的內(nèi)核鏡像zImage和設(shè)備樹文件復(fù)制到tftpboot目錄下
  • 進入到uboot階段,修改環(huán)境變量并保存:
  • setenv ethaddr e6:97:d9:0c:f7:7a //設(shè)置MAC

    設(shè)置tftp服務(wù)器的IP

    setenv serverip 192.168.2.51

    設(shè)置本地的IP

    setenv ipaddr 192.168.2.85

    保存

    saveenv

    查看網(wǎng)絡(luò)連接狀態(tài):

    ping 192.168.2.51

    將ubuntu中tftp共享文件夾下test.txt加載到內(nèi)存0X80800000

    tftpboot 80800000 zImage

    總結(jié)

    以上是生活随笔為你收集整理的TFTP服务器的搭建与使用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。