[OpenWrt-Devel] Is it possible to create two images for the same device with a different set of DEVICE_PACKAGES?

Bjørn Mork bjorn at mork.no
Tue Apr 7 10:50:38 EDT 2020

Hannu Nyman <hannu.nyman at iki.fi> writes:

> I do not think that there is a nice clean solution, as I do not
> remember seeing a solution of different packages for iniramfs, factory
> and sysupgrade images.
> I would approach that with a two-step build process, using two .config recipes:
> * First a build with a smaller .config recipe without that large
> Quantenna firmware. This creates the initramfs image, (which you copy
> to a safe place before the second build)
> * Then a second build from a recipe including the Quantenna
> firmware. No need to do "make clean", so the second build is rather
> quick. That produces the full sysupgrade image.
> In your build automation scripts, those two builds could be run
> consequtively, with a copy step between them.
> That will be much easier than trying to code a logic into the actual
> OpenWrt build Makefiles.

Yes, sure, this will work for my own use.  But it doesn't solve the
general problem, with pre-built images involved.

What if I want to make a recipe that works on the OpenWrt Buildbots?
The idea was to make first time installation as easy as possible, by
providing both an image that can be installed from OEM and an image that
enables the full hardware.

I did come up with a sort of working proof-of-concept hack, where I add
a build rule like (yes, ugly - I'm not excpecting to push this):

define Build/filtered-initramfs
	rm -rf $(TARGET_DIR).x
	sed -i -e 's,CONFIG_INITRAMFS_SOURCE="$(strip $(TARGET_DIR)) ,CONFIG_INITRAMFS_SOURCE="$(strip $(TARGET_DIR)).x ,' $(LINUX_DIR)/.config
	cp -a $(TARGET_DIR) $(TARGET_DIR).x
	rm -rf $(TARGET_DIR).x/lib/firmware/qv840 $(TARGET_DIR).x/usr/lib/opkg/info/qv840-firmware.*
	$(call Image/BuildKernel/Initramfs)

I was just hoping there would be nicer ways to do it.


openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list