I’m confused how to effectively use the OpenWRT image builder. I’m compiling the whole tree from source, including the image builder, and I’d like to use the image builder so that later I can bake in configs and other files.
However, I’m unsure how to properly get the image builder to include all of the packages for which I have PACKAGE_name=y.
For example, I have LuCI set to be installed: root@dd46ebed4ab6:/workdir/openwrt-imagebuilder-mediatek-filogic.Linux-x86_64# cat .config | grep PACKAGE_luci | head CONFIG_PACKAGE_luci=y
and the .ipk is in the packages directory, but when I run make image, it doesn’t install it: Building images for mediatek - Bananapi BPi-R4 Packages: base-files ca-bundle dnsmasq dropbear e2fsprogs f2fsck firewall4 fitblk fstools kernel kmod-crypto-hw-safexcel kmod-eeprom-at24 kmod-gpio-button-hotplug kmod-hwmon-pwmfan kmod-i2c-mux-pca954x kmod-leds-gpio kmod-mt7996-233-firmware kmod-mt7996-firmware kmod-nft-offload kmod-phy-aquantia kmod-rtc-pcf8563 kmod-sfp kmod-usb3 libc libgcc libustream-mbedtls logd mkf2fs mt7988-wo-firmware mtd netifd nftables odhcp6codhcpd-ipv6only opkg ppp ppp-mod-pppoe procd-ujail uboot-envtools uci uclient-fetch urandom-seed urngd wpad-basic-mbedtls
If I set PACKAGES to everything in the packages directory, I get conflicts, presumably because some things are built as modules and thus their packages are still in there.
How can I get the image builder to create me the same build that I get from my .config and just running make world?
Maybe there are some dependencies missing. You should be able to check with make menuconfigwhich LuCI parts are selected. Does this differ from your .config file?
Are you sure the image builder is using the .config for the packages to install? When looking at it a few years back, I believe which packages are included by default were controlled by the .target_info.
grep them from file and add them as PACKAGE= in CLI?
The intended way is to ignore all automatically included default packages, and only add the additional top-level packages to the list.
You do not even need to include all "lower" dependency packages, as they are pulled in via dependencies. E.g. no need to add "sqm-scripts", if you have the LuCI app "luci-app-sqm" which pulls in the underlying sqm-scripts.
I usually build via full toolchain, but here is example of a shell script to build via imagebuilder.
One really offensive way to configure packages to be included in all full toolchain builds and in all built imagebuilders (and thus images built with it), would be to directly modify the deepest level default packages inclusion in source code, before compiling the imagebuilder itself.
The short "ultimate default" list is in include/target.mk
The guide works in the custom feed differently than I do, so I can’t speak to its specifics. My process is usually as follows:
Clone Openwrt git
Add filesfolder with a couple of overrides
cp feeds.conf.default feeds.conf
echo my repo into that file (or a local package branch in some cases)
comment out feeds I don’t need (LuCI, video, telephony)
update and install all feeds
Now, when using make menuconfig I have my feed as main folder (below Administration in my case), and can enter it and enable the package (model dependent) I want to build.
That approach has never failed to build my custom packages into images, even without specifying them in the make command. I worked a couple of times with the .config edit approach, but have defaulted back to using make menuconfig only.
What is irritating though, is that it fails to include a package like LuCI for you and not the custom stuff.
Is there an easy way to sort the packages by what is a dependency of what? I’m thinking of something like a tree view where dependencies are children, and that way I can see what top-level packages I need to add and what they’ll bring in automatically.