Host: Fedora Linux 44 KDE (x86_65)
Target: Raspberry Pi 5 (ARM64)
Tools: Podman, dd
Container Image: quay.io/iamyaash/rpi5-bootc
Firmware: github.com/worproject/rpi5-uefi

0. Build the container image and push it to quay.io

Everything in this guide starts from a bootc container image, here quay.io/iamyaash/rpi5-bootc:latest.

Although you need qemu-user-static to be installed on your host PC but I ran Podman to build the container image on a Raspberry Pi 5, so it won’t be needed.

FROM --platform=linux/arm64 quay.io/fedora/fedora-bootc:42

# Install hardware utilities, firmware packages, and essentials
RUN dnf -y install \
    NetworkManager \
    NetworkManager-wifi \
    wireless-regdb \
    linux-firmware \
    iproute \
    openssh-server \
    htop && \
    dnf clean all

# Ensure critical services start on boot
RUN systemctl enable NetworkManager sshd

Build the image: Run this in the project folder.

podman build --platform linux/arm64 -f Containerfile.rpi -t quay.io/iamyaash/rpi5-bootc:latest .

Push to quay.io:

podman login quay.io
podman push quay.io/iamyaash/rpi5-bootc:latest

Pull it into root’s storage: bootc-image-builder runs under sudo and reads root’s container storage. Pull image there before the disk image.

sudo podman pull quay.io/iamyaash/rpi5-bootc

1. Create the build configuration

bootc-image-builder reads a config.toml that defines users. A bootc image has no default login, so this file is required if you want to login. Place this file into $HOME/bootc-config

[[customizations.user]]
name = 'core'
password = 'core'
key = 'paste your ssh-rsa...public key'
groups = ['wheel']
  • With a password set, you can easily login by connecting to a display and keyboard.
  • It makes sense to use password because you can login even when the network is down.

2. Build disk.raw

I would be running this command on Raspberry Pi 5, which would build the .raw file into ARM64 format.

mkdir $HOME/bootc-build
sudo podman run --rm --privileged --security-opt label=type:unconfined_t \
-v ./bib-config.toml:/config.toml:ro \
-v ./output:/output \
-v /var/lib/containers/storage:/var/lib/containers/storage \
quay.io/centos-bootc/bootc-image-builder:latest \
--type raw \
--target-arch arm64 \
--rootfs ext4 quay.io/iamyaash/rpi5-bootc:latest

Use this in case you want to run it in the background and log in later:

 nohup sudo podman run --rm --privileged   --security-opt label=type:unconfined_t \
 -v ~/bootc-build/bib-config.toml:/config.toml:ro \
 -v ~/bootc-tmp:/output \
 -v /var/lib/containers/storage:/var/lib/containers/storage \
 quay.io/centos-bootc/bootc-image-builder:latest   
 --type raw 
 --rootfs ext4 quay.io/iamyaash/rpi5-bootc:latest > ~/bib.log 2>&1 &

Copy the image to the Raspberry Pi 5 after finish building it.

3. Setup the SD Card

lsblk -d -o NAME,SIZE,MODEL,TRAN,RM
sudo umount /dev/sda1/ /dev/sda2/ /dev/sda3
sudo wipefs -a /dev/sda
sudo dd if=<image.raw> of=/dev/sda bs=4M conv=fsync status=progress
sync
sudo partprobe /dev/sda
lsblk -f /dev/sda

Expected Output: sda1 vfat(FAT16) EFI-SYSTEM 501 Mb sda2 ext4 boot 1 GB sda3 ext4 root (~10 GB)

4. Merge the Pi 5 UEFI firmware

Download this from github. https://github.com/worproject/rpi5-uefi

mkdir -p ~/rpi5fw
unzip -o <downloaded-filename>.zip -d ~/rpi5fw
ls -R ~/rpi5fw
sudo mkdir -p /mnt/efi
sudo mount /dev/sda1 /mnt/efi
findmnt /mnt/efi
find /mnt/efi -maxdepth 3 | sort

(The snippet below was generated by Claude. I forgot to copy this part from the earlier setup.)

sudo rsync -rtv --no-perms --no-owner --no-group ~/rpi5fw/ /mnt/efi/
find /mnt/efi -maxdepth 3 | sort
cat /mnt/efi/config.txt
sync
sudo umount /mnt/efi
findmnt /mnt/efi || echo not-mounted

Expected Output:

/mnt/efi/RPI_EFI.fd
/mnt/efi/bcm2712-rpi-5-b.dtb
/mnt/efi/config.txt
/mnt/efi/EFI/BOOT/BOOTAA64.EFI
/mnt/efi/EFI/BOOT/fbaa64.efi
/mnt/efi/EFI/fedora/ (shim, grub, grub.cfg and others)

This is what makes the Pi 5 load the UEFI firmware.

First Boot and Results

I have just showed you how to build and flash into the SD Card. But the won’t be able to use Ethernet, Wifi and the Cooler Fan won’t work as well. But the USB works flawlessly.

  1. Log in by connecting a display and keyboard.
  2. Enter the password you set to log in. This is just an experimentation, and it only partially works.