This tutorial assumes your host PC is running Ubuntu 14.04.1 LTS or later and is on the same local network as your development platform; for simplicity's sake we assume a DHCP server is available on the network, too.
If using Juno, ensure you are using the front ethernet port.
See this page for instructions on how to network mount a userspace filesystem using U-Boot.
Install the following packages on your host PC:
$ sudo apt-get update && sudo apt-get install xinetd tftpd tftp
Create file `/etc/xinetd.d/tftp' with the following contents:
`/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 }
Create directory `/tftpboot/' (this matches the `server-args' above) and set its permissions:
`/tftpboot/'
`server-args'
$ sudo mkdir /tftpboot/ $ sudo chmod -R 777 /tftpboot/ $ sudo chown -R nobody /tftpboot/
Restart the `xinetd' service:
`xinetd'
$ sudo service xinetd restart
Test the server by creating a simple `test' file in `/tftpboot/':
`test'
$ cd /tftpboot/ $ echo "this is a test" > test $ cat test this is a test
Get the IP address of your host PC via `ifconfig', then from another system:
`ifconfig'
$ tftp <host_pc_ip_address> tftp> get test Sent 159 bytes in 0.0 seconds tftp> quit $ cat test this is a test
After confirming that the TFTP server is working correctly, copy your kernel image, device tree blob, and ramdisk (where appropriate) to `/tftpboot/'. This example expects the paths to be as follows:
`/tftpboot/Image'
`/tftpboot/juno/juno.dtb'
Power up the Juno board and interrupt U-Boot's default boot selection:
The default boot selection will start in 3 seconds
Save your host PC's IP address to the `serverip' environment variable:
`serverip'
VExpress64# set serverip <host_pc_ip_address> VExpress64# saveenv
Next modify U-Boot's boot command to boot via TFTP:
VExpress64# set origbootcmd "$bootcmd"VExpress64# set autoload no VExpress64# set bootcmd "dhcp; tftp ${kernel_addr} ${serverip}:Image; tftp ${fdt_addr} ${serverip}:juno/juno.dtb; booti ${kernel_addr} - ${fdt_addr}" VExpress64# saveenv
Reboot the Juno; it should now boot via TFTP.
This is a persistent change, i.e. the Juno will boot via TFTP on every power up. To revert back to the default boot behaviour:
VExpress64# set bootcmd "$origbootcmd"
This section is not applicable from Linaro Release 16.02 onwards; the EDK-II based UEFI provided as part of the deliverables does not support TFTP boot. We've left this information here for legacy support.
First select the `Boot Manager' option:
[1] Linaro image in NOR Flash - VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/norkern - Arguments: dtb=board.dtb initrd=ramdisk.img console=ttyAMA0,115200 androidboot.hardware=juno systemd.log_target=null rootwait root=/dev/sda2 sky2.mac_address=0x04 ----------------------- FDT Device Paths - VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/r1a57.dtb ----------------------- [2] Shell [3] Boot Manager [4] Reboot [5] Shutdown Start: 3
Select `Add Boot Device Entry':
[1] Add Boot Device Entry [2] Update Boot Device Entry [3] Remove Boot Device Entry [4] Update FDT path [5] Return to main menu Choice: 1
Select `TFTP on MAC Address':
[1] Firmware Volume (0 MB) - MemoryMapped(0xB,0xE0000000,0xE00EFFFF) [2] Firmware Volume (0 MB) - MemoryMapped(0xB,0xFE792000,0xFEBAED3F) [3] NOR Flash (63 MB) - VenHw(E7223039-5836-41E1-B542-D7EC736C5E59) [4] PXE on MAC Address: 00:02:F7:00:66:E3 - MAC(0002F70066E3,0x1) [5] TFTP on MAC Address: 00:02:F7:00:66:E3 - MAC(0002F70066E3,0x1) Select the Boot Device: 5
Enter each setting as shown below, where `<host_pc_ip_address>' is the IP address of your host PC in the form `aaa.bbb.ccc.ddd'. Note that in this example the filesystem is on a USB stick (`/dev/sda2').
`<host_pc_ip_address>'
`aaa.bbb.ccc.ddd'
`/dev/sda2'
Get the IP address from DHCP: [y/n] y Get the TFTP server IP address: <host_pc_ip_address> File path of the EFI Application or the kernel : Image Is an EFI Application? [y/n] n Has FDT support? [y/n] y Add an initrd: [y/n] n Arguments to pass to the binary: console=ttyAMA0,115200 earlyprintk=pl011,0x7ff80000 root=/dev/sda2 rootwait verbose debug Description for this new Entry: TFTP boot example
Next update the FDT entry for the TFTP boot entry:
[1] Add Boot Device Entry [2] Update Boot Device Entry [3] Remove Boot Device Entry [4] Update FDT path [5] Return to main menu Choice: 4 [1] Firmware Volume (0 MB) - MemoryMapped(0xB,0xE0000000,0xE00EFFFF) [2] Firmware Volume (0 MB) - MemoryMapped(0xB,0xFE792000,0xFEBAED3F) [3] NOR Flash (63 MB) - VenHw(E7223039-5836-41E1-B542-D7EC736C5E59) [4] PXE on MAC Address: 00:02:F7:00:66:E3 - MAC(0002F70066E3,0x1) [5] TFTP on MAC Address: 00:02:F7:00:66:E3 - MAC(0002F70066E3,0x1) Select the Boot Device: 5 Get the IP address from DHCP: [y/n] y Get the TFTP server IP address: <tftp server ip address> File path of the FDT blob : juno/juno.dtb
Finally, return to the main menu and select the new `TFTP boot example' option:
[1] Add Boot Device Entry [2] Update Boot Device Entry [3] Remove Boot Device Entry [4] Update FDT path [5] Return to main menu Choice: 5 [1] Linaro image in NOR Flash - VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/norkern - Arguments: dtb=board.dtb initrd=ramdisk.img console=ttyAMA0,115200 androidboot.hardware=juno systemd.log_target=null rootwait root=/dev/sda2 sky2.mac_address=0x04 [2] TFTP boot example - MAC(0002F70066E3,0x1)/IPv4(aaa.bbb.ccc.ddd)/Image - Arguments: console=ttyAMA0,115200 earlyprintk=pl011,0x7ff80000 root=/dev/sda2 rootwait verbose debug - LoaderType: Linux kernel with FDT support ----------------------- FDT Device Paths - MAC(0002F70066E3,0x1)/IPv4(xxx.xxx.xxx.xxx)/juno/juno.dtb ----------------------- [3] Shell [4] Boot Manager [5] Reboot [6] Shutdown Start: 2