Linux system image build scripts for RK3576 based boards
The scripts in this repository produce disk images for Rockchip RK3576 based boards, ready to be flashed to an SD card or uploaded to internal storage via a USB connection and Maskrom mode.
You don't necessarily have to build images yourself. Most commits include a small green checkmark in the GitHub interface next to the commit message (or a red cross if we are less lucky), which links to a page in our Buildbot web interface with full build logs and links to pre-built images for all relevant boards, which our automated build system produces whenever something updates either in this repository or in one of its dependencies. Building from source is only necessary if you want to modify the system.
For a straightforward walkthrough of the Flipper One Linux image build flow, see the official How to build Linux image documentation.
Related repositories
This repo contains build scripts only. The full system is assembled from several components:
| Repository |
Description |
| flipperone-linux-build-scripts |
Build scripts that assemble complete disk images for RK3576-based boards (this repo) |
| flipper-linux-kernel |
Linux kernel patches and configuration for Flipper One RK3576-based boards |
| flipperone-mcu-firmware |
Firmware for the low-power RP2350 MCU |
| flipperdevices/u-boot |
Flipper fork of U-Boot; adds defconfigs for Flipper One and EVB1 on top of upstream |
| flipperdevices/rkbin |
Rockchip binary firmware blobs — DDR init blob and prebuilt Maskrom USB loader (always required), plus vendor BL31 when USE_BL31=vendor |
| ARM-software/arm-trusted-firmware |
Open-source Trusted Firmware-A; used as BL31 by default |
The build scripts pull the kernel and other components automatically — you don't need to clone other repos manually unless you want to modify them.
What's in this repo
Build scripts (run them in order):
| Script |
What it does |
build-uboot.sh |
Clones U-Boot and TF-A (or uses Rockchip's binary BL31), builds the bootloader and SPL loader for each target board |
build-kernel-mainline.sh |
Clones flipper-linux-kernel, merges config fragments from configs/linux/, builds arm64 kernel .deb packages and DTBs |
build-kernel-bsp.sh |
Clones Rockchip's BSP kernel (develop-6.1), fetches vendor DTS files, applies patches from patches/bsp/, builds arm64 kernel packages |
build-images.sh |
Assembles complete GPT disk images for all boards you've built bootloaders for; calls build-rootfs-img.sh to build the root filesystem if it doesn't exist yet |
build-rootfs-img.sh |
Runs debos on debian-rk3576-img.yaml to install the kernel into a partitioned image, then zeekstd-compresses it |
build-ospack.sh |
Runs mmdebstrap via debos (debian-rk3576-ospack.yaml) to build the Debian root filesystem tarball |
build-flipctl.sh |
Builds flipctl (the panel UI) from flipctl-slint for arm64, natively or cross, and stages /usr/bin/flipctl, its remote-view assets, its unit and the sysusers, udev and modules-load files the unit needs for the ospack; no apps ship, they are installed from the catalogue; called by build-ospack.sh |
Other directories:
configs/ — kernel config fragments merged on top of the base config (minconfig-mainline for mainline, linux-bsp/ for the BSP kernel)
overlays/ — files copied into the root filesystem: systemd units, NetworkManager config, Broadcom Wi-Fi/BT firmware, KDE Plasma settings, SDDM autologin, U-Boot menu config
vendor-dts/ — Luckfox Omni3576 DTS/DTSI files and BSP device tree overlay sources (.dtso) for the EVB evaluation board and shared peripherals
patches/bsp/ — kernel patches applied to the BSP tree (TypeC, panfrost DTS, audio card)
rk_unpacker/ — standalone Python tool to extract partition images from Rockchip update.img files
prebuilt/, src/, out/ — build outputs and source clones; all gitignored
Automated builds
Every push to this repository (and to the tracked branches of its dependencies) triggers a full build on Buildbot. The resulting images land at dl-linux-images.flipp.dev/full-img/ and are updated automatically.
Supported boards
| Board |
Target name |
Notes |
Flipper One Prototype |
flipper-one |
Our current Flipper One prototype |
|
sige5 |
Same hardware sold under two names. Has DisplayPort on USB-C. Recommended for development. |
|
rock-4d |
No DisplayPort on USB-C. Entering Maskrom requires a USB-A to USB-A cable. Available with eMMC or UFS storage — see eMMC note below. |
|
nanopi-m5 |
Available with optional UFS storage module. UFS module part number differs from Flipper One prototypes, so there may be subtle behavior differences. |
|
omni3576 |
|
|
roc-pc |
|
| Rockchip RK3576 EVB1 |
evb |
Official Rockchip evaluation board. Not available for sale. |
How to build image manually
The scripts are designed to run on Debian 13 (trixie). Other distributions may work but you'll need to find the equivalent packages yourself.
Quick start with Docker or Podman
Use the included Dockerfile to avoid installing anything on the host:
# Clone the repo
git clone https://github.com/flipperdevices/flipperone-linux-build-scripts
cd flipperone-linux-build-scripts
# Build the container image (one-time; typically 20–30 min depending on network and CPU)
docker build -t flipperone-linux-build-scripts .
# Run a full build — images appear in out/images/
mkdir -p out
docker run --privileged --rm -v "$(pwd)/out:/artifacts" \
flipperone-linux-build-scripts
Replace docker with podman if that's what you have. --privileged is required because debos and mmdebstrap use loop devices and mount namespaces.
Quick start with VS Code Dev Container
- Install VS Code and the Dev Containers extension
- Clone this repository and open it in VS Code
- Press
F1 and select "Dev Containers: Reopen in Container"
- Wait for the container to build (first time only)
- Run build scripts from the integrated terminal
Building on a bare Debian 13 host
For the bootloader:
sudo dpkg --add-architecture arm64
sudo apt update
sudo apt install git build-essential crossbuild-essential-arm64 bison flex \
python3-dev python3-libfdt python3-setuptools swig libssl-dev gnutls-dev \
python3-pyelftools device-tree-compiler
For the kernel:
sudo dpkg --add-architecture arm64
sudo apt update
sudo apt install git build-essential crossbuild-essential-arm64 bc bison flex \
imagemagick libssl-dev libdw-dev libelf-dev debhelper libssl-dev:arm64 rsync
For assembling disk images — debos, bmaptool, and zeekstd all need to be installed from source:
sudo apt install golang pipx pigz zstd parted fdisk btrfs-progs mmdebstrap \
systemd-resolved systemd-container qemu-user-binfmt \
libglib2.0-dev libostree-dev fakemachine
# Rust, for zeekstd below and for flipctl during the ospack build. From backports:
# flipctl needs rustc 1.92 (slint) and trixie has 1.85. libstd-rust-dev:arm64 is the
# standard library for the target, needed to cross-build flipctl on an amd64 host.
echo 'deb http://deb.debian.org/debian trixie-backports main' \
| sudo tee /etc/apt/sources.list.d/backports.list
sudo apt update
sudo apt install -t trixie-backports cargo rustc libstd-rust-dev libstd-rust-dev:arm64
# debos
go install -v github.com/go-debos/debos/cmd/debos@latest
sudo install -m 755 ~/go/bin/debos /usr/local/bin
# zeekstd
cargo install --git https://github.com/rorosen/zeekstd.git zeekstd_cli
sudo install -m 755 ~/.cargo/bin/zeekstd /usr/local/bin/
# bmaptool (Flipper fork)
sudo pipx install --global git+https://github.com/flipperdevices/bmaptool.git@flipper-devel
For flashing images to boards over USB:
sudo apt install rockusb
Building the bootloader
To fetch and build U-Boot with open-source TF-A:
./build-uboot.sh
The default source is the Flipper fork of U-Boot (flipperdevices/u-boot, branch rk3576), which has defconfigs for all supported boards. Upstream U-Boot now supports most boards listed here — NanoPi M5, NanoPi R76S, Luckfox Omni3576, ArmSoM Sige5, Firefly ROC-RK3576-PC, and Radxa Rock 4D. The Flipper fork is needed for Flipper One and EVB1.
To build for a specific board instead of all boards:
BOARD=sige5 ./build-uboot.sh
If you need a different U-Boot source tree (e.g., a newer upstream tree for a specific board):
BOARD=sige5 UBOOT_GIT="https://source.denx.de/u-boot/contributors/kwiboo/u-boot.git" UBOOT_BRANCH="rk3576" ./build-uboot.sh
BOARD=omni3576 KEEP_SRC=yes ./build-uboot.sh
BOARD=nanopi-m5 KEEP_SRC=yes ./build-uboot.sh
BOARD=rock-4d KEEP_SRC=yes ./build-uboot.sh
KEEP_SRC=yes reuses the already-cloned source tree; KEEP_SRC=update pulls the latest commits without a full re-clone.
To use Rockchip's binary BL31 instead of open-source TF-A:
USE_BL31=vendor BOARD=sige5 UBOOT_GIT="https://source.denx.de/u-boot/contributors/kwiboo/u-boot.git" UBOOT_BRANCH="rk3576" ./build-uboot.sh
USE_BL31=vendor BOARD=omni3576 KEEP_SRC=yes ./build-uboot.sh
USE_BL31=vendor BOARD=nanopi-m5 KEEP_SRC=yes ./build-uboot.sh
USE_BL31=vendor BOARD=rock-4d KEEP_SRC=yes ./build-uboot.sh
Outputs go to prebuilt/u-boot/<board>/ — u-boot-rockchip.bin, rk3576_loader_v*.bin, and rk3576_loader_fspi1_v*.bin per board, plus USB loader variants.
Falcon mode images
The script can also put a kernel and an initrd into the combined FIT image next to U-Boot proper. SPL loads that FIT — either from storage or from the payload uploaded to RAM over USB — and boots the kernel out of it directly, skipping U-Boot proper entirely. FALCON_FLAVORS lists the flavours that can be built; it defaults to installer bootmenu recovery. Each flavour carries its own kernel and its own initrd, given as <FLAVOUR>_KERNEL and <FLAVOUR>_INITRD:
RECOVERY_KERNEL=/path/to/vmlinuz RECOVERY_INITRD=/path/to/rootfs.cpio.gz ./build-uboot.sh
A flavour is built only when its <FLAVOUR>_KERNEL names a readable file, so you can build any subset in one run; the script stops if a flavour is requested without a readable <FLAVOUR>_INITRD. The kernel may be compressed (gzip, xz, zstd, lz4, bzip2 or lzma) — the compression is detected and undone automatically. Adding a flavour of your own needs no change to the script, just another word in FALCON_FLAVORS.
Each flavour produces three more files in prebuilt/u-boot/<board>/: <flavour>-falcon.itb, <flavour>-falcon-usb472.bin