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

Tomasz Maciej Nowak tomek_n at o2.pl
Tue Apr 7 11:16:00 EDT 2020

Hi Bjørn.

W dniu 07.04.2020 o 16:50, Bjørn Mork pisze:
> 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)
> endef
> I was just hoping there would be nicer ways to do it.

In include/kernel-defaults.mk there is
INITRAMFS_EXTRA_FILES ?= $(GENERIC_PLATFORM_DIR)/image/initramfs-base-files.txt.
Maybe You could add a logic for ignore files list if they exist. No other
solution comes to my mind. 

> Bjørn
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

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

More information about the openwrt-devel mailing list