Breadcrumbs

Booting via network adapter (TFTP/NFS)

In a development environment where you need to do a lot of testing while changing the kernel and rootfs, it is often helpful to have the system on your development machine and share the files via network with your target device. Please use the eth0 Ethernet on the Kontron board.

In combination with the Yocto build system you can export the <builddir>/tmp/deploy/images directory via TFTP to allow the target to fetch the kernel image, devicetrees, etc. To allow the target to use a rootfs over the network, you need to export the rootfs via NFS on your development machine.

Setup on the host

To install the servers:

Bash
sudo apt-get install tftpd-hpa
sudo apt-get install nfs-kernel-server

Change the TFTPD-settings by changing the content of /etc/default/tftpd-hpa:

Bash
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftproot"
TFTP_ADDRESS="[::]:69"
TFTP_OPTIONS="--secure"

Change the NFS-settings by changing the content of /etc/exports:

Bash
/nfsroot *(rw,no_root_squash,sync,no_subtree_check)

Boot

To extract the rootfs and initialize the servers, you can use the init-remote2 script in layers/meta-webpanel/scripts:


Bash
user@user:~/yocto-ktn/<build-dir>$ sudo ../layers/meta-webpanel/scripts/init-remote2 <build-dir> <image-name> <machine-name>
For example:

user@user:~/yocto-ktn/build-01013$ sudo ../layers/meta-webpanel/scripts/init-remote2 build-01013 image-kontron-base 11555

u-boot Environment Settings:

Bash
# board ip address
setenv ipaddr 192.168.1.124
# server ip address
setenv serverip 192.168.1.155
# board boot devices
setenv boot_targets net mmc1 mmc0 net

If you want your settings to be persistent, don't forget to run saveenv.
Then you are ready to boot by running boot.