Build different subtargets in different directories

I'm currently building test images for two devices that are subtargets of the same target: lantiq-xrx200-arcadyan_vgv7510kw22-brn (o2 Box 6431) and lantiq-xrx200-bt_homehub-v5a (BT Home Hub 5A). Is there an option to have the output files end up in two different directories? As it is now, the binary files are preserved, but the text files get clobbered by the new build for a different subtarget: config.buildinfo, feeds.buildinfo, version.buildinfo.

Is there an option to keep subtarget outputs separate? I have done a little searching, but nothing turned out.

Why do you want to do two separate builds in the first place, instead of building both in the same run?

e.g. (abbreviated):

CONFIG_TARGET_lantiq=y
CONFIG_TARGET_lantiq_xrx200=y
CONFIG_TARGET_MULTI_PROFILE=y
CONFIG_TARGET_PER_DEVICE_ROOTFS=y
CONFIG_TARGET_DEVICE_lantiq_xrx200_DEVICE_bt_homehub-v5a=y
CONFIG_TARGET_DEVICE_PACKAGES_lantiq_xrx200_DEVICE_bt_homehub-v5a=""
CONFIG_TARGET_DEVICE_lantiq_xrx200_DEVICE_arcadyan_vgv7510kw22-brn=y
CONFIG_TARGET_DEVICE_PACKAGES_lantiq_xrx200_DEVICE_arcadyan_vgv7510kw22-brn=""
CONFIG_TARGET_DEVICE_lantiq_xrx200_DEVICE_arcadyan_vgv7510kw22-nor=y
CONFIG_TARGET_DEVICE_PACKAGES_lantiq_xrx200_DEVICE_arcadyan_vgv7510kw22-nor=""

For obvious reasons (asterisk16&&asterisk16-chan-lantiq, I assume) you probably want to include different packages for the BTHH5A and the O² Box 6431, that's where the TARGET_DEVICE_PACKAGES enter the picture, which allows you to include any package previously built as a module (CONFIG_PACKAGE_=m) or to remove a default package by prepending -PACKAGENAME.

1 Like

Spot on, @slh: it's asterisk16&&asterisk16-chan-lantiq indeed.

Thanks for your instructive reply. However, in your elegant solution there are quite a few things I don't understand yet. Are your example lines of code part of the .config file? I've never seen such syntax. Does the whole list of (non-default?) packages have to fit between the double quotes in, e.g.,

CONFIG_TARGET_DEVICE_PACKAGES_lantiq_xrx200_DEVICE_bt_homehub-v5a=""

?
Does the -PACKAGENAME clause have to go within those quotes too? Otherwise, how does make know which device I'm removing the package from?

I've got too many questions, I think, and definitely too newbish. Could you please point me to a resource where I can study the syntax of a config file? I'd like to stop bothering you on basic config file structure issues :blush:

The elegance of the solution you suggest is in having just one set of version info files rather than two.

In menuconfig, under Target Devices, enable

Use a per-device root filesystem that adds profile packages

which will allow you to setup the packages per device as outlined.

Snippet
CONFIG_TARGET_DEVICE_mvebu_cortexa9_DEVICE_linksys-wrt1200ac=y
CONFIG_TARGET_DEVICE_PACKAGES_mvebu_cortexa9_DEVICE_linksys-wrt1200ac="-mwlwifi-firmware-88w8964 -wpad-mini -dnsmasq -mwifiex-sdio-firmware -kmod-bluetooth mwlwifi-firmware-88w8864"
CONFIG_TARGET_DEVICE_mvebu_cortexa9_DEVICE_linksys-wrt1900acs=y
CONFIG_TARGET_DEVICE_PACKAGES_mvebu_cortexa9_DEVICE_linksys-wrt1900acs="-mwlwifi-firmware-88w8964 -wpad-mini -dnsmasq -mwifiex-sdio-firmware -kmod-bluetooth mwlwifi-firmware-88w8864"
CONFIG_TARGET_DEVICE_mvebu_cortexa9_DEVICE_linksys-wrt1900acv2=y
CONFIG_TARGET_DEVICE_PACKAGES_mvebu_cortexa9_DEVICE_linksys-wrt1900acv2="-mwlwifi-firmware-88w8964 -wpad-mini -dnsmasq -mwifiex-sdio-firmware -kmod-bluetooth mwlwifi-firmware-88w8864"
CONFIG_TARGET_DEVICE_mvebu_cortexa9_DEVICE_linksys-wrt3200acm=y
CONFIG_TARGET_DEVICE_PACKAGES_mvebu_cortexa9_DEVICE_linksys-wrt3200acm="-mwlwifi-firmware-88w8864 -wpad-mini -dnsmasq haveged mwifiex-sdio-firmware bluez-utils bluez-daemon bluelog bluelog-live bluez-libs mwlwifi-firmware-88w8964"
CONFIG_TARGET_PER_DEVICE_ROOTFS=y

yes, space separated.

@anomeome @slh wow, thanks - it's building right now :slight_smile:

I tried to make the configuration seed prettier with backslashes, but make defconfig likes it ugly. In other words, something like this won't work.

# This isn't correct. Un-prettify by deleting backslashes and joining lines

CONFIG_TARGET_lantiq=y
CONFIG_TARGET_lantiq_xrx200=y
CONFIG_TARGET_MULTI_PROFILE=y
CONFIG_TARGET_PER_DEVICE_ROOTFS=y
CONFIG_TARGET_DEVICE_lantiq_xrx200_DEVICE_bt_homehub-v5a=y
CONFIG_TARGET_DEVICE_PACKAGES_lantiq_xrx200_DEVICE_bt_homehub-v5a=""
CONFIG_TARGET_DEVICE_lantiq_xrx200_DEVICE_arcadyan_vgv7510kw22-brn=y
CONFIG_TARGET_DEVICE_lantiq_xrx200_DEVICE_arcadyan_vgv7510kw22-nor=y

CONFIG_PACKAGE_asterisk16-chan-lantiq=m
CONFIG_PACKAGE_asterisk16=m

# un-prettify
CONFIG_TARGET_DEVICE_PACKAGES_lantiq_xrx200_DEVICE_arcadyan_vgv7510kw22-brn="\
	CONFIG_PACKAGE_asterisk16-chan-lantiq=y\
	CONFIG_PACKAGE_asterisk16=y"
CONFIG_TARGET_DEVICE_PACKAGES_lantiq_xrx200_DEVICE_arcadyan_vgv7510kw22-nor="\
	CONFIG_PACKAGE_asterisk16-chan-lantiq=y\
	CONFIG_PACKAGE_asterisk16=y"

Trying to force asterisk into the brnboot images will be rather challenging, as those are limited to 7168k (my O² Box NOR images with chan_lantiq && pjsip weigh slightly less than 13 MB, with a limit of 15232k).

Oops! Thanks for pointing that out. Honestly, I don't know the differences between brnboot and NOR, but the method I've found for the first flash uses brnboot (here it is: Installing LEDE/u-boot via brnboot web interface (without rs232) ), so I'll need brnboot to begin with.

I guess I'll have to use an overlay as outlined here: [How To] install and configure a full Voip server (Asterisk 13 & 16) on OpenWrt . Can/should I stick to brnboot for that?

(Now make is done, and it hasn't indeed produced a NOR image near the expected size.)