Contents

Fedora CoreOS 35 USB Boot on Raspberry Pi 4

Note: While the RPI now boots, if I have anything else plugged into USB ports, such as a keyboard, it throws the same TRB related error.

For whatever reason, Fedora’s support of Raspberry Pi4’s seems a bit iffy. The official documentation (here) is quite good, and I managed to easily get the RPI4 booting CoreOS via the EDK2 UEFI firmware approach. The problem was that I wanted to use the U-Boot approach, and that was just not playing ball.

I tried Fedora CoreOS 34 and 35, as well as various development versions for 36 and 37, all with and without the steps in the documentation regarding updating the files from the RPMs:

  • uboot-images-armv8
  • bcm2711-firmware
  • bcm283x-firmware
  • bcm283x-overlays

Every single combination/variation I tried resulted in the error "Unexpected XHCI event TRB, skipping..." on attempting to boot.

There is a bug report about this issue, but it appears to be closed, you can read it here.

After a little bit of searching, it seems there are some updates to the uboot-images-armv8 package as seen here, and they are available in rawhide.

Using the rawhide packages to update the CoreOS 35 install worked, and the RPI boots successfully.

Script adapted from the official documentation:

#!/bin/bash

# The target Fedora Release. Use the same one that current FCOS is based on.
RELEASE=$1
DEV=$2
IMAGE=$3

TMPDIR="/tmp/RPi4boot/${RELEASE}"

rm -rf "${TMPDIR}"
mkdir -p "${TMPDIR}"/boot/efi/

sudo dnf install -y --downloadonly --release=$RELEASE --forcearch=aarch64 --destdir="${TMPDIR}"/  uboot-images-armv8 bcm283x-firmware bcm283x-overlays

for rpm in "${TMPDIR}"/*rpm
do
  rpm2cpio $rpm | sudo cpio -idv -D "${TMPDIR}"/
done

sudo mv ${TMPDIR}/usr/share/uboot/rpi_4/u-boot.bin ${TMPDIR}/boot/efi/rpi4-u-boot.bin



FCOSDISK="/dev/${DEV}"
FCOSEFIPARTITION=$(lsblk $FCOSDISK -J -oLABEL,PATH  | jq -r '.blockdevices[] | select(.label == "EFI-SYSTEM")'.path)
umount /tmp/FCOSEFIpart
mkdir -p /tmp/FCOSEFIpart

sudo coreos-installer install --architecture=aarch64 -f "${IMAGE}" --insecure -i rpi4.ign "${FCOSDISK}"

sudo mount "$FCOSEFIPARTITION" /tmp/FCOSEFIpart

sudo rsync -avh --ignore-existing "${TMPDIR}"/boot/efi/ /tmp/FCOSEFIpart/

sudo umount "$FCOSEFIPARTITION"

Download the CoreOS 35 image, and run the script like this:

./update.sh rawhide sdf fedora-coreos-35.20220313.2.0-metal.aarch64.raw.xz

That will put Fedora Rawhides U-Boot files for RPI4 in place and should successfully boot.

I’m not sure if these updated packages will make it into CoreOS 35, or will only be available in CoreOS 36.

References

  1. https://docs.fedoraproject.org/en-US/fedora-coreos/provisioning-raspberry-pi4/
  2. https://bugzilla.redhat.com/show_bug.cgi?id=1993250
  3. https://packages.fedoraproject.org/pkgs/uboot-tools/uboot-images-armv8/

CoreOS Ignition/Butane File

For reference, below is the Butane file I used to bootstrap my Pi, using Butane is documented here

Change the password_hash and all instances of the word "username" to whatever actual username you want.

variant: fcos
version: 1.4.0
passwd:
  users:
  - name: username
    password_hash: <password hash here>
    groups:
    - wheel
    - docker

storage:
  links:
    - path: /etc/localtime
      target: ../usr/share/zoneinfo/UTC

  files:
    - path: /etc/ssh/sshd_config.d/20-enable-passwords.conf
      mode: 0644
      contents:
        inline: |
                    PasswordAuthentication yes

    - path: /etc/sudoers.d/username
      mode: 0644
      contents:
        inline: |
                    username  ALL=(ALL) NOPASSWD:ALL

    - path: /etc/NetworkManager/system-connections/eth0.nmconnection
      mode: 0600
      contents:
        inline: |
          [connection]
          id=eth0
          type=ethernet
          interface-name=eth0
          [ipv4]
          may-fail=false
          method=auto          

    - path: /etc/hostname
      overwrite: true
      contents:
        inline: rasppi4

    - path: /etc/profile.d/systemd-pager.sh
      mode: 0644
      contents:
        inline: |
          # Tell systemd to not use a pager when printing information
          export SYSTEMD_PAGER=cat          

    - path: /etc/sysctl.d/20-silence-audit.conf
      mode: 0644
      contents:
        inline: |
          # Raise console message logging level from DEBUG (7) to WARNING (4)
          # to hide audit messages from the interactive console
          kernel.printk=4