← All posts

prplOS porting (3): why add another CONFIG layer on top of OpenWrt

Grow through practice

No need to finish reading — test now

One line: OpenWrt's .config is a build output; prplOS's profile is a product recipe. prplOS does not replace Kconfig; it adds a composable, reproducible recipe layer above it.

Admit it: OpenWrt can already configure

OpenWrt's native configuration is strong:

target/linux/<target>/<subtarget>
  ├─ target.mk
  ├─ config-6.6
  └─ image/Makefile   # DEVICE_*, DEVICE_PACKAGES
make menuconfig      # choose target/subtarget/device/packages
make defconfig       # resolve dependencies/defaults
make -j$(nproc)      # output bin/targets/...

Feeds are there too:

./scripts/feeds update -a
./scripts/feeds install -a

So “can it build a firmware?” — OpenWrt already answers that.

Then why does prplOS add a layer

Because prplOS is not targeting “one router”; it faces:

  • multiple chips/boards: x86, IPQ, MTK, mvebu, MXL, Airoha;
  • multiple product shapes: Gateway, Extender, LCM, Mgmt, Security;
  • multiple feeds: feed_amx, feed_prplmesh, feed_prplos, vendor feeds;
  • multiple build combinations that must be reproducible in CI.

With .config alone, there are three hard problems.

1) .config is output, not source

.config is often thousands of lines, mostly defaults filled by make defconfig:

  • code review cannot see “what this product actually added”;
  • diffs between two products are extremely noisy;
  • after an OpenWrt upgrade, changed defaults pollute the diff.

prplOS records the intent in YAML:

# conceptual example
include: [prpl_core, lcm, mgmt]
packages: [dmtui, tr181-led]
feeds: [...]
diffconfig: |
  CONFIG_TARGET_ROOTFS_EXT4FS=y

Then gen_config.py generates .config. The source is the profile; the artifact is .config.

2) No composition mechanism

OpenWrt's DEVICE_PACKAGES adds packages per device, not per product:

  • prpl = prpl_core + lcm + mgmt
  • extender_full = lcm + mgmt + prpl_core
  • extender_minimal = prpl_core

With .config alone, such “feature bundle + product shape” composition is copy-paste; YAML include makes it reusable.

3) Feed versions must be pinned

In prplOS, prpl_core pins feed revisions:

feed_amx      main@762470...
feed_prplmesh main@3086fd...
feed_prplos   main@7d4815...

.config does not record them; feeds.conf does, but separately from the product recipe. A profile keeps target + packages + feeds + diffconfig in one file, so CI can reproduce one product from one profile.

What the layer actually does

scripts/gen_config.py:

read YAML (with include)
  → clean .config/feeds
  → install feeds declared by the profile (pinned revisions)
  → write target/subtarget/device + packages to .config
  → make defconfig

It does not invent a new build system; the engine is still OpenWrt Kconfig + make.

The cost is real

  • extra learning layer: YAML, include, feeds, diffconfig, plus OpenWrt;
  • hidden defaults: when it breaks, go back to the generated .config;
  • destructive: gen_config.py deletes .config and feeds; not safe to run casually on an existing build;
  • profile drift: target/device names may change with OpenWrt upgrades;
  • vendor feeds/SDK: mxl_*/ipq* are not buildable from a profile alone.

When native OpenWrt is enough

  • one or a few devices;
  • no multi-product composition;
  • no need to reproduce many configs in CI;
  • .config is acceptable as the only source.

Then make menuconfig + make defconfig is more direct.

Verification status (site mission)

  • ✅ source/mechanism: gen_config.py, profiles/*.yml, prpl_core feed revisions checked;
  • ✅ config generation: qemu_armsr produced .config with TARGET_armsr/armv8/DEVICE_generic;
  • ⚠️ no multi-product build comparison: did not build two profiles and diff CI time/artifacts;
  • ❓ long-term maintenance cost: profile drift/upgrade cost needs a real project.

One sentence

OpenWrt's Kconfig decides “how to build”; prplOS's profile decides “which product to build”. The layer is not a replacement for OpenWrt; it makes “many boards, many shapes, many feeds” composable and reproducible.


Source: gen_config.py · profiles Counterpart: OpenWrt's configuration system · prplOS official profiles · GEN_CONFIG armsr 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.