This document explains the required steps to boot Linux Kernel and mount a NFS on your target.
A functional Yocto environment (Images generated for your target).
Your preferred target. (SABRE-AI, SABRE-SD)
1 Ethernet Cable
1 Micro USB cable
USB to Serial converter depending on your target features.
3 Yocto Folders
When you develop your Linux kernel and Root File System with Yocto, different folders are created and each folder contains different information.
This directory contains the output images, like Kernel, U-Boot and the File System in a tar file. This directory will be used to fetch the kernel and device tree blob file only.
This folder contains all the development files used to generate our Yocto images. Here we can find all the dynamic libraries and headers used for development. This folder is used as parameter for cross-compilation.
This folder contains the uncompressed rootfs of our target. This folder will be used as entry in the host NFS server.
4 IP Address and Network Setup
This section covers how to boot Linux that mounts the root file system (RFS) over the network. Remember that in this scenario, the RFS exists on the laptop hard drive, and the kernel that runs on the target board will mount the RFS over Ethernet. This setup is used for developing and debugging Linux applications. It allows for applications to be loaded and run without having to re-boot the kernel each time.
First some packages on your host need to be installed:
For development, it is best to have a static IP setup for the board and Linux environment. This way U-Boot options won’t change between reboots as you get a new IP address as you would using DHCP.
4.1 Linux Host Setup
This section describes how to setup a static IP in your Linux host environment. This is not required but will allow the IP address of your virtual host system to remain unchanged. Because u-boot parameters use specific IP addresses, this step is recommended because u-boot parameters may need to be updated in the future to match your virtual IP address if it should ever change.
You could take the existing IP address and make it static, but you would lose the Internet connection in your virtual machine. Instead we want to make use of the virtual environment and add a secondary Ethernet port that is tied to your wired Internet connection, while keeping the original Ethernet port which can use the wireless connection on your laptop.
In the Linux virtual environment, type sudo ifconfig and note that you should have one Ethernet adapter (eth0). The other item listed (lo) is a virtual port for loopback mode.
Shutdown the Linux virtual machine
In VMware Player, go to Edit virtual machine settings. And add a Bridged Network Adapter, choosing only the wired Ethernet port.
And click on OK. See below for example:
Start up the Linux VM.
Open a terminal and type:
You should have a new entry (eth1).This is the new Ethernet port you created in the virtual machine, and it is bridged to your wired Ethernet port. This is the port we want to make a static IP address.
To set eth1 to a static IP, open /etc/nework/interfaces
sudo gedit /etc/network/interfaces
Add the following to set eth1 to your desired IP address.
iface eth1 inet static
address 192.168.0.100 <-- Your HOST IP
Save the file
sudo ifdown eth1
sudo ifup eth1
4.2 Target Setup
We need to setup the network IP address of our target.
Power On the board and hit a key to stop the U-Boot from continuing.
Set the below parameters:
setenv serverip 192.168.0.100<-- This must be your Host IP address
setenv ipaddr 192.168.1.102<-- This must be your target IP addres
setenv ip_dyn no
The path where the rootfs is placed in our host has to be indicated in the U-Boot:
Now configure the Trivial File Transfer Protocol (TFTP) server and Networked File System (NFS) server. This is how U-Boot will download (via TFTP) the Linux kernel, and then the kernel will mount (via NFS) its root file system on the computer hard drive.
4.3.1 TFTP Setup
Next setup the TFTP server. The following commands show that we are logged in as root (#). If you are not root ($) then precede each instruction with “sudo”.