We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

4 posts • Page 1 of 1
PackElend
Posts: 14
Joined: Mon Nov 21, 2016 1:18 pm

Headless (mostly) Fedora CoreOS on RPi4 - A Brief Updated How To

Thu Jan 02, 2025 7:05 pm

Hello,
making my way through many tutorials as Headless (mostly) Fedora CoreOS on RPi4 - A Brief How To (updated 9 Oct) - Raspberry Pi Forums and libgpiod, I can say, things a bit easier now, you don't even need a Federoa Desktop or Server running.
At least until the very first boot and being able to log in:
  1. devicetree not working with EDK2
  2. U-Boot via USB
  3. wifi still to be included in ignition
  4. pass through hardware (GPIO HAT, Bluetooth)
I provisioned 100% on Raspberry Pi OS, without any Fedora OS running, using Podman Images.

my procedure from Producing an Ignition Config :: Fedora Docs instead Getting started | Butane, see https://github.com/coreos/butane/issues/573
To create the password hash, follow the description given in Using Password Authentication - Configuring Users :: Fedora Docs

Code: Select all

$ podman run -ti --rm quay.io/coreos/mkpasswd --method=yescrypt
Password:
$y$j9T$A0Y3wwVOKP69S.1K/zYGN.$S596l11UGH3XjN...
than create your ignition file and run

Code: Select all

podman run --interactive --rm --security-opt label=disable \
 --volume ${PWD}:/pwd --workdir /pwd quay.io/coreos/butane:release \
 --pretty --strict config.bu > config.ign
than as described on Provisioning Fedora CoreOS on the Raspberry Pi 4 :: Fedora Docs

before you install find the right disk using

Code: Select all

lsblk -o name,mountpoint,label,size,uuid
than follow:
  1. CoreOS Install

    Code: Select all

     FCOSDISK=/dev/sda
     STREAM=stable # or `next` or `testing`
     echo $FCOSDISK
     echo $STREAM
     sudo podman run --pull=always --privileged --rm \
     -v /dev:/dev -v /run/udev:/run/udev -v .:/data -w /data \
     quay.io/coreos/coreos-installer:release \
     install -a aarch64 -s $STREAM -i config.ign $FCOSDISK 
    I didn't follow the instructions in the U-Boot installation, it worked well without the flag in either case.
    We pass in --append-karg nomodeset here to workaround an issue where monitor output will be lost during system boot
    .
  2. UEFI Firmware
    1. U-Boot
      You need to be able to run Fedora Tools, so you may want to run the toolbox, which is not available for Pi OS.
      To run Fedora Tools, you install distrobox
      It only pulls the Fedora-minimal image of around 50 MB, see fedora/fedora-minimal · Quay

      Code: Select all

      sudo apt install distrobox
      distrobox-create --name my-container --image fedora:41
      distrobox-enter my-container
      sudo dnf install cpio
      sudo dnf install rsync
      
      Inside the container, you run the commands as given in Installing FCOS and Booting via U-Boot.
      Download the binaries

      Code: Select all

      RELEASE=41 # The target Fedora Release. Use the same one that current FCOS is based on.
      mkdir -p /tmp/RPi4boot/boot/efi/
      dnf download --resolve --releasever=$RELEASE --forcearch=aarch64 --destdir=/tmp/RPi4boot/ uboot-images-armv8 bcm283x-firmware bcm283x-overlays
      for rpm in /tmp/RPi4boot/*rpm; do rpm2cpio $rpm | sudo cpio -idv -D /tmp/RPi4boot/; done
      sudo mv /tmp/RPi4boot/usr/share/uboot/rpi_arm64/u-boot.bin /tmp/RPi4boot/boot/efi/rpi-u-boot.bin
      exit
      
      put them in the disk outside the container.
      I adapted the command slightly to avoid the error chown operation errors:

      Code: Select all

      rsync: [receiver] chown "/tmp/FCOSEFIpart/..." failed: Operation not permitted (1)
      .
      I followed the advice given in "rsync: failed to set permissions on ..." error with rsync -a or -p option - Unix & Linux Stack Exchange.
      That error could be due to running things in a container and locally on the host.

      Code: Select all

      FCOSDISK=/dev/sda
      FCOSEFIPARTITION=$(lsblk $FCOSDISK -J -oLABEL,PATH | jq -r '.blockdevices[] | select(.label == "EFI-SYSTEM").path')
      mkdir /tmp/FCOSEFIpart
      sudo mount $FCOSEFIPARTITION /tmp/FCOSEFIpart
      sudo rsync -avh --no-o --no-g --ignore-existing /tmp/RPi4boot/boot/efi/ /tmp/FCOSEFIpart/
      sudo umount $FCOSEFIPARTITION
      
    2. EDK2

      Code: Select all

       FCOSEFIPARTITION=$(lsblk $FCOSDISK -J -oLABEL,PATH | jq -r '.blockdevices[] | select(.label == "EFI-SYSTEM")'.path)
       mkdir /tmp/FCOSEFIpart
       sudo mount $FCOSEFIPARTITION /tmp/FCOSEFIpart
       pushd /tmp/FCOSEFIpart
       VERSION=v1.38 # use latest one from https://github.com/pftf/RPi4/releases
       sudo curl -LO https://github.com/pftf/RPi4/releases/download/${VERSION}/RPi4_UEFI_Firmware_${VERSION}.zip
       sudo unzip RPi4_UEFI_Firmware_${VERSION}.zip
       sudo rm RPi4_UEFI_Firmware_${VERSION}.zip
       popd
       sudo umount /tmp/FCOSEFIpart 
       
Last edited by PackElend on Sun Mar 30, 2025 4:47 pm, edited 6 times in total.

PackElend
Posts: 14
Joined: Mon Nov 21, 2016 1:18 pm

Re: Headless (mostly) Fedora CoreOS on RPi4 - A Brief Updated How To

Thu Jan 02, 2025 7:10 pm

Butane or Ignition config

Code: Select all

variant: fcos
version: 1.0.0
passwd:
 users:
 - name: admin
 groups:
 - "sudo"
 - "docker"
 password_hash: hidden
systemd:
 units:
 - name: docker.service
 enabled: true
 - name: containerd.service
 enabled: true
 - name: [email protected]
 dropins:
 - name: autologin-core.conf
 contents: |
 [Service]
 # Override Execstart in main unit
 ExecStart=
 # Add new Execstart with `-` prefix to ignore failure
 ExecStart=-/usr/sbin/agetty --autologin admin --noclear %I $TERM
 TTYVTDisallocate=no 
storage:
 files:
 - path: /etc/hostname
 mode: 0644
 contents:
 inline: |
 CoreOS 
 - 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 
 - path: /etc/ssh/sshd_config.d/20-enable-passwords.conf
 mode: 0644
 contents:
 inline: |
 # Enable SSH password login
 PasswordAuthentication yes 
 - path: /etc/NetworkManager/system-connections/wifi1.nmconnection
 mode: 0600
 contents:
 inline: |
 [connection]
 id=Local
 type=wifi
 interface-name=wlan0
 [wifi]
 ssid=SRF_E090
 mode=infrastructure
 [wifi-security]
 key-mgmt=wpa-psk
 psk=hidden
 [ipv4]
 method=auto
 [ipv6]
 method=auto
 - path: /etc/NetworkManager/system-connections/wifi2.nmconnection
 mode: 0600
 contents:
 inline: |
 [connection]
 id=MobileHotSpot
 type=wifi
 interface-name=wlan0
 [wifi]
 ssid=FP4
 mode=infrastructure
 [wifi-security]
 key-mgmt=wpa-psk
 psk=hidden
 [ipv4]
 method=auto
 [ipv6]
 method=auto 
 links:
 - path: /etc/localtime
 target: ../usr/share/zoneinfo/Europe/Berlin


PackElend
Posts: 14
Joined: Mon Nov 21, 2016 1:18 pm

Re: Headless (mostly) Fedora CoreOS on RPi4 - A Brief Updated How To

Sun Mar 30, 2025 3:25 pm

added U-Boot instructions
U-Boot is not working, I haven't tried to troubleshoot yet.
added reference how to create a password hash

4 posts • Page 1 of 1

Return to "Pidora / Fedora"

AltStyle によって変換されたページ (->オリジナル) /