In this project, we show how to boot the AMD Kria KR260 board using a network-based PetaLinux image, delivered via TFTP for the kernel and NFS for the root filesystem. This significantly reduces development cycle time - no need to flash SD cards every time you rebuild the system.
This tutorial builds on the previous two:
- Project 1: Run PetaLinux in Docker: Isolated Development
- Project 2: Build a Custom PetaLinux Image for Kria Board
Note: An SD card is still required in the Kria board to provide initial boot files - specifically boot.scr
. However, no root filesystem or full image is needed on the SD card. This keeps boot time fast and setup flexible.
In Project-1, we installed a TFTP server inside the Docker container during the build process. However, this server isn’t used at runtime—it’s only included to satisfy PetaLinux’s internal environment checks.
Instead, the actual TFTP server must run natively on your host machine.
To make file sharing seamless, the Dockerfile creates a symbolic link:
/tftpboot → ~/workspace/tftpboot
This means:
- PetaLinux inside Docker copies boot files to
/tftpboot
- These files appear in
~/…/workspace/tftpboot
on the host - Your host TFTP server serves this directory to the Kria board
1. Install the TFTP server:
sudo apt install tftpd-hpa
2. Edit the configuration file /etc/default/tftpd-hpa
and set:
TFTP_DIRECTORY="/home/<your-user>/kria-petalinux/workspace/tftpboot"
3. Restart the TFTP service:
sudo systemctl restart tftpd-hpa
Verifying TFTP Server FunctionalityYou can test it by trying to fetch a file using TFTP:
cd ~
tftp <host-ip-addr> -c get system.dtb
ls -l system.dtb
rm system.dtb
If the command succeeds, your host is correctly serving files from the shared /tftpboot
directory. This ensures your Docker-based PetaLinux build system and host runtime environment are properly integrated for network booting.
The NFS (Network File System) root filesystem allows the target device (e.g., a Kria board) to boot Linux with its root filesystem hosted over the network. This approach is especially useful during development, as it enables rapid testing and debugging without the need to reflash an SD card every time you make changes.
To set up NFS root for your Petalinux system, follow these steps:
1. Extract the Root Filesystem inside Docker:
cd ~/workspace/
sudo rm -rf nfsroot
sudo mmkdir -m 777 nfsroot
sudo tar -xpf kria_kr260_project/images/linux/rootfs.tar.gz -C nfsroot/
ls -l nfsroot/
2. Export the NFS Directory from Your Host PC:
Exit the Docker container and return to your host system.
Edit the NFS exports configuration:
sudo vi /etc/exports
Add the following line to the file (adjust the path if needed):
/path/to/kria-petalinux/workspace/nfsroot/ *(rw,no_root_squash,async,no_subtree_check)
3. Restart the NFS Server:
sudo exportfs -ra
sudo systemctl restart nfs-kernel-server
Your root filesystem is now shared over the network and ready to be used as the target’s rootfs via NFS booting.
Verifying NFS Server FunctionalityTo verify that your NFS server is working correctly, you can mount the shared directory and list its contents:
cd /mnt
sudo mkdir nfs
sudo mount -t nfs <your-host-ip-adr>:/path/to/kria-petalinux/workspace/nfsroot ./nfs
ls -l ./nfs
sudo umount ./nfs
sudo rmdir nfs
If the commands execute without errors and list the expected files, your NFS server is functioning properly. This ensures that your target system will be able to access the root filesystem over the network.
Manually Booting Kria from TFTP/NFS via U-BootOnce both the TFTP and NFS servers are correctly set up on your host PC, you can manually test booting the Kria board over the network using U-Boot. This is a good way to verify that everything is working before automating the process.
1. Connect via UART and Interrupt U-Boot
Connect to the Kria board over UART and interrupt the U-Boot countdown to access the CLI.
Note: Leave the SD card inserted in the Kria board. If not, U-Boot may crash during resource discovery.
2. Set Network Configuration
Configure the IP addresses for both the host PC and the Kria board:
setenv serverip <host-ip-address>
setenv ipaddr <kria-ip-address>
3. Set Memory Addresses for Kernel and Device Tree
Define where the Linux kernel and the device tree will be loaded in RAM:
setenv kernel_addr 0x00200000
setenv fdt_addr 0x00100000
4. Load Kernel and Device Tree via TFTP
Fetch the kernel and device tree from the TFTP server:
tftpboot $kernel_addr Image
tftpboot $fdt_addr system.dtb
5. Set Boot Arguments
Set the bootargs
environment variable. Replace <host-ip-address>
and the NFS root path /path/to/
with your actual values:
setenv bootargs console=ttyPS0,115200 root=/dev/nfs rw rootwait nfsroot=<host-ip-address>:/path/to/kria-petalinux/workspace/nfsroot,v3 ip=dhcp cma=900M init=/sbin/init
6. Boot the Board
Finally, boot the board using:
booti $kernel_addr - $fdt_addr
Once booted, the board should operate using the kernel from TFTP and the root filesystem mounted over NFS. Verify that everything functions similarly to when the board boots from the SD card, as described in Project-2.
Automating the Boot ProcessOnce you’ve successfully booted the system manually, the next step is to automate the process. This can be done by creating a U-Boot script (boot.scr
) that automates loading the kernel and device tree over TFTP and boots the Kria from an NFS root filesystem.
1. Create the boot.cmd
Script
You can either download the boot.cmd
file from the Attachments section or manually create it inside the Docker container in the shared /tftpboot
directory (which must be accessible from the Kria board):
cd ~/workspace/tftpboot
cat << EOF > boot.cmd
# Script for U-Boot
#
# To generate boot.scr use:
# mkimage -A arm64 -T script -C none -n "Kria Netboot" -d boot.cmd boot.scr
#
# configuration
setenv ipaddr <kria-ip-address>
setenv serverip <host-ip-address>
setenv path_to_nfsroot /path/to/kria-petalinux/workspace/nfsroot
setenv kernel_addr 0x00200000
setenv fdt_addr 0x00100000
tftpboot ${kernel_addr} Image
tftpboot ${fdt_addr} system.dtb
setenv bootargs console=ttyPS0,115200 root=/dev/nfs rw rootwait nfsroot=${serverip}:${path_to_nfsroot},v3 ip=on cma=900M init=/sbin/init
booti ${kernel_addr} - ${fdt_addr}
EOF
Make sure to replace <host-ip-address>
and <kria-ip-address>
with the correct values, and update the nfsroot path /path/to/
to point to the actual location of your NFS root filesystem on the host.
2. Compile the U-Boot Script
Use mkimage
(available in the Docker container) to compile the script into a binary format that U-Boot understands:
mkimage -A arm64 -T script -C none -n "Kria Netboot" -d boot.cmd boot.scr
3. Update the SD Card
Now you can copy the boot.scr
file to the SD card’s FAT32 boot partition. This file alone is enough to boot the system from the network—no ext4 rootfs partition is needed anymore.
However, for convenience and fallback, it’s recommended to:
- Keep all existing files on the SD card.
- Backup the original
boot.scr
.
4. Copy boot.scr to SD Card via U-Boot (Optional)
You can copy the boot.scr
file directly from the host to the SD card using U-Boot, without removing the SD card from the Kria board:
setenv serverip <host-ip-addr>
setenv ipaddr <board-ip-addr>
tftpboot 0x3000000 boot.scr
printenv filesize
usb start
ls usb 0:1
fatwrite usb 0:1 0x3000000 boot.scr ${filesize}
reset
What this does:
- Downloads
boot.scr
via TFTP into RAM at address 0x3000000. - Reads the transferred file size from the environment variable
filesize
. - Initializes the USB interface and lists USB drives to ensure the SD card is detected.
- Writes the file from RAM to the first USB device’s first partition (typically the SD card’s FAT32 partition).
Once this is done, simply reset the board. U-Boot will load and execute the new boot.scr
, and your Kria will boot automatically from the network using your NFS rootfs.
Now that everything is set up, you can boot the Kria board using a network-based configuration. After performing a power reset on the board, it should:
- Load
boot.scr
from the SD card - Fetch the Linux kernel (
Image
) and device tree blob (system.dtb
) via TFTP - Mount the root filesystem over NFS
- Boot into Linux without requiring a full root filesystem or image on the SD card
Once booted, verify that essential functionality works as expected—such as networking, DNS resolution, and access to the mounted root filesystem.
This setup provides a flexible and efficient workflow for rapid development and testing.
SummaryYou now have a flexible and efficient development setup:
- Kernel and device tree loaded via TFTP
- Root filesystem mounted over NFS
- Minimal SD card usage — only
boot.scr
is required - No image flashing needed between iterations
This workflow significantly speeds up kernel development, debugging, and user-space experimentation, making it ideal for rapid iteration.
Next StepIn the next project, we’ll take it even further by attaching a full Ubuntu root filesystem and using chroot from within PetaLinux. This will let you combine the robustness of PetaLinux with the rich ecosystem of Ubuntu — a powerful hybrid approach to embedded Linux development.
Comments