Running Flatcar Container Linux on Raspberry Pi 4
Hardware Requirements
- A Raspberry Pi 4
- Form of storage, either USB and/or SD card. USB 3.0 drive is recommended for the better performance in terms of price.
- Display (via micro HDMI/HDMI/Serial Cables)
- Keyboard
Before we start
A word of warning:
- The UEFI firmware used in this guide is an UNOFFICIAL firmware , provided under an open source BSD license.
- Flatcar Container Linux support for Raspberry Pi is still in its early stages and is not thoroughly tested.
- Deploy Flatcar Container Linux on the hardware for purely fun and learning.
- Please follow the documentation at your own risk.
Update the EEPROM
The Raspberry PI 4 uses an EEPROM to boot the system. Before proceeding ahead, it is recommended to update the EEPROM. Raspberry Pi OS automatically updates the bootloader on system boot. In case you are using Raspberry Pi OS already, then the bootloader may be already updated.
For manually updating the EEPROM, you can either use the Raspberry Pi Imager or the raspi-config. The former is the recommended method in the Raspberry Pi documentation .
We will also see later how the RPi4 UEFI firmware needs a recent version of EEPROM.
Using the Raspberry Pi Imager (Recommended)
- Install the Raspberry Pi Imager software. You can also look for the software in your distribution repository.
- Launch
Raspberry Pi Imager. - Select
Misc utility imagesunderOperating System. - Select
Bootloader. - Select the boot-mode,
SD,USB - Select the appropriate storage,
SDorUSB - Boot the Raspberry Pi with the new image and wait for at least 10 seconds.
- The green activity LED will blink with a steady pattern and the HDMI display will be green on success.
- Power off the Raspberry Pi and disconnect the storage.
Using the raspi-config
- Update the
rpi-eeprompackage in the Raspberry Pi OS running.
|
|
- Run
sudo raspi-config - Select
Advanced Options. - Select
Bootloader Version - Select
Latestfor latest Stable Bootloader release. - Reboot
Using the rpi-eeprom-update
- Update the
rpi-eeprompackage in the Raspberry Pi OS running.
|
|
- Check if there are available updates.
|
|
- Install the update
|
|
Installing Flatcar
Install flatcar-install script
Flatcar provides a simple installer script that helps install Flatcar Container Linux on the target disk. The script is available on Github , and the first step would be to install the script in the host system.
|
|
Install Flatcar on the target device
Now that the flatcar-install script is installed in the host machine, go ahead and install the Flatcar Container Linux image on the target device.
The target device could be a USB drive or SD Card.
The options that we will be using with the scripts are:
|
|
- The device would be the target device that you would like to use. You can use the
lsblkcommand to find the appropriate disk. For the example we would be using/dev/sda. - With the given values of
channelandboard, the script would download the image, verify it with gpg, and then copy it bit for bit to disk. - In our case, Flatcar does not yet ship Raspberry PI specific OEM images yet so the value will be an empty string
''. - Pass the Ignition file,
config.jsonin my case, to provision the Pi during boot.
|
|
Go ahead with the write on the target device
|
|
If you already have the image downloaded you can use the -f param to specify the path of the local image file.
|
|
Raspberry Pi 4 UEFI Firmware
rpi-uefi community ships a SBBR-compliant(UEFI+ACPI), ArmServerReady ARM64 firmware for Raspberry Pi 4. We will be using it to UEFI boot Flatcar.
v1.17 of the
pftf/RPi4
introduced two major changes:
- Firstly, it enabled firmware boot directly from the USB. This is particularly helpful if you are using the installation process using a USB device.
- Secondly, support for directly placing the Pi boot files into the EFI System Partition (ESP). This feature was not implemented in the firmware, rather from the upstream firmware from Raspberry Pi Foundation. This is why it is recommended to update the Pi EEPROM at the very beginning.
Let’s move ahead with the final steps.
- Place the UEFI firmware into the EFI System Partition.
|
|
- Remove the
USB/SDfrom the host device and attach it into the Raspberry Pi 4 and boot.
In no time, your Raspberry Pi would boot and present you with a Flatcar Container Linux prompt.
Further Reading
- rpi4-uefi.dev - RPi4 UEFI Firmware Official Website
- Raspberry Pi documentation