← All posts

prplOS porting (2): GEN_CONFIG — targeting QEMU armsr/armv8

Grow through practice

No need to finish reading — test now

One line: the first step of porting prplOS is not a driver; it is making gen_config.py know your target. Upstream profiles do not include armsr; this article adds it.

Previous: prplOS official profiles (1): 26 profiles, layered.

Why GEN_CONFIG

prplOS is based on OpenWrt, but the build entry point is not plain make menuconfig:

profiles/*.yml → scripts/gen_config.py → .config → make

gen_config.py:

  • cleans the old .config / feeds;
  • installs feeds declared by the profile;
  • writes target/subtarget/device and packages into .config;
  • finally runs make defconfig.

So it is the first gate for porting a new board: pick the wrong target and everything after is wrong.

What the official README omits

target/linux/armsr/README explains how to boot armsr images with QEMU, but not:

  • that prplOS profiles/ has no armsr;
  • how to generate an armsr config with gen_config.py;
  • which device the QEMU virt machine uses.

This article fills that gap.

What armsr is

armsr = ARM SystemReady, OpenWrt's multi-platform ARM target:

  • armv7: 32-bit;
  • armv8: 64-bit;
  • device name: generic;
  • images can boot directly on QEMU virt.

For prplOS, it is the best virtual target to “get it running” before owning a board.

Write a qemu_armsr profile

In the prplOS root:

# profiles/qemu_armsr.yml
---
profiles:
  - generic
target: armsr
subtarget: armv8
description: QEMU ARM SystemReady (armv8) demo profile
diffconfig: |
  CONFIG_TARGET_ROOTFS_EXT4FS=y
  CONFIG_TARGET_ROOTFS_INITRAMFS=y

Fields:

FieldValueMeaning
targetarmsrOpenWrt target
subtargetarmv864-bit
profilesgenericdevice name, maps to DEVICE_generic
diffconfigtwo linesext4 + initramfs

To avoid touching the source tree, put the profile elsewhere: GENCONFIG_PROFILE_DIRS="./profiles:/path/to/my-profiles" ./scripts/gen_config.py qemu_armsr.

Run GEN_CONFIG

./scripts/gen_config.py qemu_armsr

It first pulls the default OpenWrt feeds. In the first local run it stopped at:

Cloning into './feeds/packages'...
fetch-pack: unexpected disconnect while reading sideband packet

That is a network problem, not a config error. To verify target selection first, I ran it once with an empty feeds file:

cp feeds.conf.default /tmp/feeds.conf.default.bak
: > feeds.conf.default
./scripts/gen_config.py qemu_armsr
cp /tmp/feeds.conf.default.bak feeds.conf.default

The generated .config had:

CONFIG_TARGET_armsr=y
CONFIG_TARGET_armsr_armv8=y
CONFIG_TARGET_armsr_armv8_DEVICE_generic=y
CONFIG_TARGET_ROOTFS_INITRAMFS=y
CONFIG_TARGET_ROOTFS_EXT4FS=y

Those three TARGET_armsr* lines prove the target was selected correctly.

Empty feeds produce recursive-dependency warnings for dnsmasq-full / libnetfilter-conntrack; restore feeds and update online before a full build.

Full build (not completed)

make -j"$(nproc)"

Outputs:

bin/targets/armsr/armv8/

The important QEMU artifacts:

*-generic-initramfs-kernel.bin
*-generic-ext4-rootfs.img
*-generic-ext4-combined-efi.img.gz

Boot in QEMU

The official armsr/README gives this minimal armv8 command:

qemu-system-aarch64 -machine virt -cpu cortex-a57 -nographic \
  -kernel bin/targets/armsr/armv8/*-generic-initramfs-kernel.bin

For EFI/disk images:

gunzip -c bin/targets/armsr/armv8/*-generic-ext4-combined-efi.img.gz > openwrt-arm-64.img
qemu-system-aarch64 -nographic \
  -cpu cortex-a53 -machine virt \
  -bios bin/targets/armsr/armv8/u-boot-qemu_armv8/u-boot.bin \
  -smp 1 -m 1024 \
  -device virtio-rng-pci \
  -drive file=openwrt-arm-64.img,format=raw,index=0,media=disk \
  -netdev user,id=testlan -net nic,netdev=testlan \
  -netdev user,id=testwan -net nic,netdev=testwan

Applying it to a real board

Banana Pi R3 follows the same idea with different parameters:

target   = mediatek
subtarget= filogic
profiles = bananapi_bpi-r3

Then:

./scripts/gen_config.py bpi-r3 prpl debug
make -j"$(nproc)"

Reference: Holisticon's BPI-R3 walkthrough.

Boundaries and verification status

  • ✅ profile mechanism: verified against gen_config.py, profiles/*.yml, target/linux/armsr;
  • ✅ target selection: qemu_armsr generated .config with TARGET_armsr/armv8/DEVICE_generic;
  • ⚠️ full build not completed: feeds fetch failed; empty feeds was only for config verification;
  • ⚠️ QEMU not booted: commands come from target/linux/armsr/README; no image was built/downloaded here;
  • ❓ prpl features: the minimal armsr profile does not include prpl_core; running the prpl data model needs prpl_core/prpl and confirmation that packages exist on armsr.

One sentence

GEN_CONFIG is the “pick the board” step of prplOS porting: the profile must be right, then .config is right; only then do QEMU or a real board make sense. The official docs do not say how to configure armsr; this article adds the missing step.


Source: prplOS (840cf16) · gen_config.py Target notes: armsr README Related: prplOS vs OpenWrt · From UCI to a data model Series: prplOS Porting & Build.

Practice

Found this useful?

I write about AI agents × embedded / edge AI. Subscribe, or email me a concrete problem.

Guestbook →Subscribe (RSS)Support

Comments 0

No comments yet — be the first!

No login required; name is optional.