This project automates the creation of a custom Ubuntu-based SD card image for the AMD/Xilinx Kria KV260 board using Docker. It leverages QEMU for ARM64 emulation, allowing you to build and configure the image entirely on an x86_64 host system.
- Automated Docker-based build environment for ARM64 Ubuntu images
- Customizable scripts for adding packages and post-install configurations
- Generation of
.wicSD card images ready to boot on Kria boards - Support for setting up users, SSH, networking, locale, and timezone
- Shared directories for easy script and file management between host and container
Ensure your host system meets the following requirements:
- Operating System: Ubuntu 22.04 LTS (or compatible)
- Docker Engine: Version 28.1.1 or newer
- QEMU: Version supporting ARM64 emulation
Install Docker and QEMU:
sudo apt update
sudo apt install docker.io qemu-user-staticAdd your user to the Docker group to run Docker without sudo:
sudo usermod -aG docker $USER
newgrp dockerRegister QEMU to enable ARM64 emulation.
docker run --rm --privileged multiarch/qemu-user-static --reset -p yesSet up a Docker builder that supports ARM64:
docker buildx create --name kria-builder --usekria-build-system/
├── boot/
│ ├── boot.scr
│ ├── Image
│ └── system.dtb
├── build.sh
├── Dockerfile
├── LICENSE
├── output/
│ └── custom-linux-image.wic.zip
├── README.md
├── rootfs/
├── run.sh
├── scripts/
│ ├── additional-packages.sh
│ ├── build-kria-image.sh
│ ├── make_wic_image.sh
│ ├── mount-chroot-ro.sh
│ ├── post-config.sh
│ └── umount-chroot-ro.sh
└── workspace/
└── ubuntu-base-22.04-base-arm64.tar.gz
boot/: Contains bootloader files (boot.scr,Image,system.dtb)scripts/: Shell scripts for building and configuring the imageworkspace/: Contains the base Ubuntu ARM64 root filesystemoutput/: Directory where the final.wicimage is stored
git clone https://github.com/s59mz/kria-build-system.git
cd kria-build-system./build.sh./run.shThis command mounts necessary directories and shares the host's /dev to the container, which is required for loop device operations during image creation.
Inside the Docker container, execute:
./scripts/build-kria-image.shThis script performs the following steps:
- Downloads and extracts the base Ubuntu ARM64 root filesystem
- Mounts the root filesystem and chroots into it
- Installs additional packages specified in
additional-packages.sh - Applies post-configuration settings from
post-config.sh - Creates a
.wicSD card image and compresses it into a.zipfile
The final image will be located at output/custom-linux-image.wic.zip.
- To add additional packages, edit
scripts/additional-packages.sh. - For post-install configurations (e.g., setting up users, SSH, networking), modify
scripts/post-config.sh.
In case your build fails due to Segmentation Faults, try this command and rebuild again.
docker run --rm --privileged multiarch/qemu-user-static --reset -p yesThis project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
For more information and updates, visit the Hackster.io project page.