前提條件
假設您的主機PC運行的是Ubuntu 14.04.1 LTS或更高版本,並且與您的開發平台在同一個本地網絡上;為了簡單起見,我們假設網絡上也有DHCP服務器。
如果使用Juno,請確保使用的是前端以太網端口。
設置TFTP服務器
在您的主機PC上安裝以下軟件包:
$ sudo apt-get update && sudo apt-get install xinetd tftpd tftp
創建文件/etc/xinetd.d/tftp,內容如下:
service tftp { protocol = udp port = 69 socket_type = dgram wait = yes user = nobody server = /usr/sbin/in.tftpd server_args = /tftpboot disable = no }
創建目錄'/tftpboot/'(與上面的' server-args'匹配)並設置其權限:
$ sudo mkdir /tftpboot/ $ sudo chmod -R 777 /tftpboot/ $ sudo chown -R nobody /tftpboot/
重新啟動xinetd的服務:
$ sudo service xinetd restart
通過在'/tftpboot/'中創建一個簡單的' test '文件來測試服務器:
$ cd /tftpboot/ $ echo "this is a test" > test $ cat test this is a test
通過' ifconfig'獲取主機的IP地址,然后從另一個系統:
$ tftp <host_pc_ip_address> tftp> get test Sent 159 bytes in 0.0 seconds tftp> quit $ cat test this is a test
確認TFTP服務器工作正常后,將內核映像、設備樹blob和ramdisk(如果合適的話)復制到' /tftpboot/'。本例期望路徑如下:
- Kernel image: `/tftpboot/Image'
- Device tree blob:`/tftpboot/juno/juno.dtb'
U-Boot TFTP
打開Juno板並中斷U-Boot的默認啟動選擇:
The default boot selection will start in 3 seconds
將主機PC的IP地址保存到“serverip”環境變量:
VExpress64# set serverip <host_pc_ip_address> VExpress64# saveenv
下一步修改U-Boot的引導命令,通過TFTP引導:
VExpress64# set origbootcmd "$bootcmd" VExpress64# set bootcmd "dhcp: tftp ${kernel_addr} ${serverip}:Image; tftp ${fdt_addr} ${serverip}:juno/juno.dtb; booti ${kernel_addr} - ${fdt_addr}" VExpress64# saveenv
重新啟動juno板,現在應該通過TFTP引導。
這是一個永久的更改,即Juno將通過TFTP在每次電源啟動時啟動。恢復到默認啟動行為:
VExpress64# set bootcmd "$origbootcmd"