Starting with RCE SDK V1.7.0, Linux may be loaded over NFS and run as a diskless node.
At boot, the following files are copied over NFS into bootloader memory:
- uImage - RCE Linux kernel
- devicetree.dtb - RCE device tree
- fpga.bit - RCE firmware bitfile
At Linux boot, the NFS served Arch Linux ARM installation is mounted as the root filesystem.
Install the SDK
First, download and install the latest RCE SDK.
Fetch the Arch Linux ARM Installation
Download and extract the Arch Linux filesystem to an NFS served directory on your host system.
wget http://os.archlinuxarm.org/os/ArchLinuxARM-zedboard-latest.tar.gz
tar -xzf ArchLinuxARM-zedboard.latest.tar.gz
The directory your Arch Linux installation is extracted to will be referred to as <arch_linux_root>.
Prepare the Arch Linux installation
mkdir <arch_linux_root>/boot (if not already present)
mkdir <arch_linux_root>/var/lib/machines
Copy the following files from the RCE SDK to the Arch Linux filesystem:
cp arm-linux/tgt/linux/fstab.diskless <arch_linux_root>/etc/fstab
cp arm-linux/tgt/linux/kernel/uImage to <arch_linux_root>/boot
cp arm-linux/tgt/linux/kernel/devicetree.dtb to <arch_linux_root>/boot
cp arm-linux/tgt/linux/boot/<rce_type>/fpga.bit, or your own firmware file, to <arch_linux_root>/boot/fpga.bit
Remove the following service file links:
rm /etc/systemd/system/sockets.target.wants/systemd-networkd.socket
rm /etc/systemd/system/multi-user.target.wants/systemd-networkd.service
For console or SSH login, allow read access to shadow:
chmod a+r shadow
For SSH usage, allow root login permission by modifying the SSH daemon configuration:
edit sshd_config - PermitRootLogin yes
For SSH usage, allow read/write access for ssh key generation:
chmod a+rw /etc/ssh
Change back to read-only after first boot
Configure the NFS server
Make sure <arch_linux_root> is exported by your NFS server
Configure the DHCP server
Set the next-server parameter to the IP address of the NFS server.
next-server <nfs_server_ip_address>
Set the root filesystem path to the Arch Linux installation
option root-path "<arch_linux_root>"
See arm-linux/tgt/linux/dhcpd.dtm.conf in the RCE SDK for example entries.
Prepare the RCE bootloader
First, update the RCE bootloader (boot.bin) with the version in the latest SDK.
Boot the RCE into the bootloader.
Reset the default u-boot environment, save, and reset
zynq-uboot> env default -a
## Resetting to default environment
zynq-uboot> saveenv
Saving Environment to FAT...
writing uboot.env
done
zynq-uboot> reset
resetting ...
You may set nfs boot as the default boot option prior to saving the environment
zynq-uboot> setenv modeboot nfsboot
Boot Using NFS
Boot the RCE into the bootloader.
Execute the nfs boot command:
zynq-uboot> run nfsboot
Sample output:
zynq-uboot> run nfsboot
PHY not detected, assuming PHY at address 0
BOOTP broadcast 1
DHCP client bound to address 192.168.204.38
PHY not detected, assuming PHY at address 0
Gem.e000b000:0 is connected to Gem.e000b000. Reconnecting to Gem.e000b000
Using Gem.e000b000 device
File transfer via NFS from server 192.168.204.12; our IP address is 192.168.204.38
Filename '/nfsexport/users/smaldona/dat/arch-linux-arm/arch-linux/boot/uImage'.
Load address: 0x3000000
Loading: #################################################################
#########################
done
Bytes transferred = 3784144 (39bdd0 hex)
PHY not detected, assuming PHY at address 0
Gem.e000b000:0 is connected to Gem.e000b000. Reconnecting to Gem.e000b000
Using Gem.e000b000 device
File transfer via NFS from server 192.168.204.12; our IP address is 192.168.204.38
Filename '/nfsexport/users/smaldona/dat/arch-linux-arm/arch-linux/boot/devicetree.dtb'.
Load address: 0x2a00000
Loading: ##
done
Bytes transferred = 9984 (2700 hex)
PHY not detected, assuming PHY at address 0
Gem.e000b000:0 is connected to Gem.e000b000. Reconnecting to Gem.e000b000
Using Gem.e000b000 device
File transfer via NFS from server 192.168.204.12; our IP address is 192.168.204.38
Filename '/nfsexport/users/smaldona/dat/arch-linux-arm/arch-linux/boot/fpga.bit'.
Load address: 0x1000000
Loading: #################################################################
##
done
Bytes transferred = 13321492 (cb4514 hex)
design filename = "DpmTest;UserID=0XFFFFFFFF"
part number = "7z045ffg900"
date = "2014/10/22"
time = "15:38:09"
bytes in bitstream = 13321404
zynq_load: Bitstream is not swapped(1) - swap it
Net: mac 08:00:56:00:44:3f
## Booting kernel from Legacy Image at 03000000 ...
Image Name: Linux-4.4.0-xilinx-00025-g96ce8f
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3784080 Bytes = 3.6 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 02a00000
Booting using the fdt blob at 0x02a00000
Loading Kernel Image ... OK
OK
Loading Device Tree to 1fb4a000, end 1fb4f6ff ... OK
Starting kernel ...