OpenWrt composer: a new firmware building and configuration tool

I had an itch to scratch over the weekend after about the 50th time reminding myself how to use the OpenWRT image builder tool. So I created a little tool to help.

OpenWRT composer takes a YAML manifest which specifies firmware images to build, including what packages to add/remove from the firmware, and how to configure the firmware. The idea is that the firmware image is regarded as immutable; any change in configuration is achieved by producing a new firmware image and loading that onto the device.

Configuration is specified in the YAML manifest, and leverages the NetJSONConfig package to create valid configuration files which are then baked into the firmware image.

Building of the image itself is done inside a container. Currently the Podman container runtime is used, but adding Docker support is on the TODO list, and wouldn't require much work at all.

If you're interested, the code is available here: https://github.com/jonathanunderwood/openwrt-composer

It's early days, the code is rough, but it works. PRs, feature requests, critique are all welcome.

4 Likes

Very keen to work on making Podman a first class deployment methodology.

1 Like

Cool stuff, i already like LinuxKit so this is very similar.
Btw is there a way to manipulate the .config values? So stuff like this can be injected/changed from a defconfig via yaml?

CONFIG_BUSYBOX_CUSTOM=y
# CONFIG_BUSYBOX_CONFIG_BRCTL is not set
CONFIG_BUSYBOX_CONFIG_FEATURE_IP_RARE_PROTOCOLS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_IP_TUNNEL=y
CONFIG_BUSYBOX_CONFIG_FEATURE_NAMEIF_EXTENDED=y
# CONFIG_SAMBA4_SERVER_AVAHI is not set
# CONFIG_SAMBA4_SERVER_NETBIOS is not set
# CONFIG_SAMBA4_SERVER_VFS is not set

So, what this tool is doing is using the OpenWRT ImageBuilder for the target to build images from the compiled packages. It's not recompiling anything, so I don't think it would fit your use case @Andy2244.