[OpenWrt-Devel] Target profiles: making "make" build every profile

Felix Fietkau nbd at openwrt.org
Mon Sep 14 13:37:07 EDT 2015


On 2015-09-14 12:06, Jonas Gorski wrote:
> Hi,
> 
> On Mon, Sep 14, 2015 at 11:30 AM, Rafał Miłecki <zajec5 at gmail.com> wrote:
>> Quick summary:
>> Subtargets - used for building modified kernels
>> Profiles - used for including specific software
>>
>> There are two ways of using profiles:
>>
>> 1) Changing some software for all devices
>> Used when profile is used for all devices (no filtering, no per device
>> profiles).
>> This is used e.g. by brcm47xx. Normally all images will be built with
>> b43. However by changing a profile you can get *all* images to include
>> wl.ko.
>>
>> 2) Including extra software for specific devices
>> Used when profile is (group) device specific. E.g. including USB
>> drivers for devices with USB only.
>> This is something I'd like to use with bcm53xx. I'd like to include
>> brcmfmac.ko in two images only (R8000 and SR400ac). Of course, I'll
>> need to adjust target/bcm53xx/image/Makefile to:
>> a) Stop building SR400ac and R8000 images for TARGET_bcm53xx_Generic
>> b) Build above images for something new like TARGET_bcm53xx_brcmfmac
> 
> I don't think there is an issue with letting Generic build all images
> with a "common" package set as default, and still having a defined
> profile for it with a specialized package set.
> 
>> If I add TARGET_bcm53xx_brcmfmac as explained above, its images won't
>> be build anymore by default.
>> I'd like to to have a way to ask "make" for building all profiles by
>> setting some variable in target/bcm53xx/Makefile
>>
>> Can someone give me some help with implementing this?
> 
> Changing the buildroot for that would be a lot of work, as you would
> need to force all packages needed by all images as =m, and you would
> have to require them, as else the image generation will fail if the
> user decides to delect any of them (or silently drop it). And then the
> issue of deciding if a package should be included in the image or not
> based on the selected profile's default packages, the image's default
> profile's packages, and the actual selection states in .config
> 
> I think a better place would be the image builder for that. There we
> could just add e.g. a new build target like allimages that will
> iterate over all available images and build them. Or maybe
> "alldevices", and it would hook into the new Device-stuff and iterate
> over all defined devices, with the assumption that these define their
> specific profile so we don't need to add code to skip the common
> profiles.
> 
> so we would then have something like
> 
> define Device/FooDevice
>         DEVICE_PROFILE=Foo
> endef
> 
> define Device/BarDevice
>        DEVICE_PROFILE=Bar
> endef
> 
> 
> and enhance the code in include/image.mk to collect these
> DEVICE_PROFILEs to iterate over.
I like this idea. To make it easier to build an image builder for that,
we could change the metadata script to generate a hidden config symbol,
which is set to =m, depends on CONFIG_IB, and selects all packages used
by every single profile of that target (so you don't necessarily have to
use CONFIG_ALL).

We could add another symbol to guard it, so that you can also build an
image builder with a more restricted feature set that can't build all
profiles.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list