Possibly the simplest and quickest way to build an image with a modified
set of packages is using OpenWrt's Docker imagebuilder
container.
mkdir -p openwrt/bin
cd openwrt
sudo docker run --rm -v "$(pwd)"/bin/:/home/build/openwrt/bin -it openwrtorg/imagebuilder:[target]-[subtarget]-[tag]
Concretely OpenWrt 22.03.2 snapshot for Raspberry Pi 4:
sudo docker run --rm -v "$(pwd)"/bin/:/home/build/openwrt/bin -it openwrtorg/imagebuilder:bcm27xx-bcm2711-22.03.2
In the container shell, initiate building:
make image
To customize the package set, specify the modifications using the PACKAGES parameter.
Listing a package name adds the package. Listing a package name prefixed with -
removes
that package. This is a concreate example:
make image PACKAGES="-dnsmasq dnsmasq-full python3 python3-distro tailscale tailscaled file luci luci-app-firewall luci-app-opkg luci-base luci-lib-base luci-lib-ip luci-lib-jsonc luci-lib-nixio luci-mod-admin-full luci-mod-network luci-mod-status luci-mod-system luci-proto-ipv6 luci-proto-ppp luci-ssl luci-app-sqm luci-app-ddns ipset luci-app-upnp luci-theme-material prometheus-node-exporter-lua prometheus-node-exporter-lua-openwrt prometheus-node-exporter-lua-wifi kmod-usb-net-rtl8152 luci-app-watchcat irqbalance iptables-nft kmod-usb-net-asix kmod-usb-net-asix-ax88179"
The result will be under the bin
directory in the workspace. Locate the set of images
and flash away.