This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
products:sbc:common:development:setup-tftp-server [2022/07/05 23:41] nick |
products:sbc:common:development:setup-tftp-server [2022/07/08 05:53] (current) frank |
||
|---|---|---|---|
| Line 12: | Line 12: | ||
| Install TFTP packages: | Install TFTP packages: | ||
| - | ```sh | + | ```shell |
| $ sudo apt-get install openbsd-inetd tftpd tftp | $ sudo apt-get install openbsd-inetd tftpd tftp | ||
| ``` | ``` | ||
| - | * Configuration | + | Configuration: |
| - | As root, enable the TFTP server by editing | + | As root, enable the TFTP server by editing |
| ```txt | ```txt | ||
| Line 24: | Line 24: | ||
| ``` | ``` | ||
| - | Uncomment this line, and add the option and value `-s /srv/tftp` to the end of this line: | + | Uncomment this line, and add the option and value '' |
| ```txt | ```txt | ||
| Line 32: | Line 32: | ||
| Create and modify permissions on the TFTP root directory: | Create and modify permissions on the TFTP root directory: | ||
| - | ```bash | + | ```shell |
| $ sudo mkdir /srv/tftp | $ sudo mkdir /srv/tftp | ||
| $ sudo chown -R $(whoami) /srv/tftp | $ sudo chown -R $(whoami) /srv/tftp | ||
| Line 39: | Line 39: | ||
| Restart the TFTP Service: | Restart the TFTP Service: | ||
| - | ```sh | + | ```shell |
| $ sudo / | $ sudo / | ||
| ``` | ``` | ||
| Line 47: | Line 47: | ||
| Install additional TFTP packages: | Install additional TFTP packages: | ||
| - | ```sh | + | ```shell |
| $ sudo apt-get install tftp-hpa tftpd-hpa | $ sudo apt-get install tftp-hpa tftpd-hpa | ||
| ``` | ``` | ||
| - | * Configuration | + | Configuration: |
| - | As root, edit `/ | + | As root, edit '' |
| - | ```sh | + | ```shell |
| TFTP_DIRECTORY="/ | TFTP_DIRECTORY="/ | ||
| ``` | ``` | ||
| - | Change the dir to `/srv/tftp`. | + | Change the dir to '' |
| - | ```bash | + | ```shell |
| TFTP_DIRECTORY="/ | TFTP_DIRECTORY="/ | ||
| ``` | ``` | ||
| Create and modify permissions on the TFTP root directory: | Create and modify permissions on the TFTP root directory: | ||
| - | ```sh | + | ```shell |
| $ sudo mkdir /srv/tftp | $ sudo mkdir /srv/tftp | ||
| $ sudo chown -R $(whoami) /srv/tftp | $ sudo chown -R $(whoami) /srv/tftp | ||
| Line 73: | Line 73: | ||
| Restart the TFTP Service: | Restart the TFTP Service: | ||
| - | ```sh | + | ```shell |
| $ sudo service tftpd-hpa restart | $ sudo service tftpd-hpa restart | ||
| ``` | ``` | ||
| Line 85: | Line 85: | ||
| * Connect a LAN cable to your target device, and make sure your device is on same local network with your Host PC. | * Connect a LAN cable to your target device, and make sure your device is on same local network with your Host PC. | ||
| - | * Connect a " | + | * Connect a " |
| * Power-on your target device, and ensure the device has a bootloader installed in it. | * Power-on your target device, and ensure the device has a bootloader installed in it. | ||
| - | Stop U-boot from autobooting by hitting | + | Stop U-boot from autobooting by hitting |
| - | ```sh | + | ``` |
| U-Boot 2015.01 (May 18 2019 - 19:31:53) | U-Boot 2015.01 (May 18 2019 - 19:31:53) | ||
| Line 119: | Line 119: | ||
| kvim3# | kvim3# | ||
| ``` | ``` | ||
| - | Running | + | Running |
| Line 136: | Line 136: | ||
| </ | </ | ||
| - | |||
| ===== Test Your TFTP Server ===== | ===== Test Your TFTP Server ===== | ||
| - | |||
| <WRAP important > | <WRAP important > | ||
| - | VIM1/VIM2/VIM3/VIM3L is **u-boot.bin**, | + | VIM1/2/3/3L is **u-boot.bin**, |
| </ | </ | ||
| Line 150: | Line 148: | ||
| Make sure you have copied the testing file to the TFTF root path: | Make sure you have copied the testing file to the TFTF root path: | ||
| - | ```sh | + | ```shell |
| $ ls / | $ ls / | ||
| / | / | ||
| ``` | ``` | ||
| - | Load a file into the `0x1080000` address: | + | Load a file into the '' |
| ``` | ``` | ||
| kvim3# tftp 1080000 u-boot.bin | kvim3# tftp 1080000 u-boot.bin | ||
| Line 176: | Line 174: | ||
| ===== Troubleshooting ===== | ===== Troubleshooting ===== | ||
| - | * Check your LAN cable connection, if the terminal print-out looks like: | + | * Check your LAN cable connection, if the terminal print-out looks like: ``` |
| - | ``` | + | |
| kvim3# tftp 1080000 u-boot.bin | kvim3# tftp 1080000 u-boot.bin | ||
| dwmac.ff3f0000 Waiting for PHY auto negotiation to complete......... TIMEOUT ! | dwmac.ff3f0000 Waiting for PHY auto negotiation to complete......... TIMEOUT ! | ||
| Line 184: | Line 181: | ||
| ``` | ``` | ||
| - | * Check your server IP or filename address, if the print-out looks like: | + | * Check your server IP or filename address, if the print-out looks like: ``` |
| - | ``` | + | |
| kvim3#tftp 1080000 u-boot.bin | kvim3#tftp 1080000 u-boot.bin | ||
| Speed: 1000, full duplex | Speed: 1000, full duplex | ||
| Line 196: | Line 192: | ||
| Speed: 1000, full duplex | Speed: 1000, full duplex | ||
| ``` | ``` | ||
| - | In this example, I had set the server IP address to `192.168.1.177` which is incorrect. It should be `192.168.1.117` instead. | + | In this example, I had set the server IP address to '' |
| ===== See Also ===== | ===== See Also ===== | ||
| - | * [Ubuntu Wiki: TFTP](https:// | + | * [[https:// |
| - | * [Configuring TFTP servers on Linux](http:// | + | * [[http:// |