nRF Connect SDK child image per-board configuration discards associated prj.conf in 2.6.1

When building a project using a custom board, as well as both the b0 and mcuboot bootloaders enabled, board-specific child image configuration causes the build system to ignore the project-specific configuration.

I'm using the following directory structure:

<wk> - Workspace directory
<wk>/<prj> - Project directory
<wk>/<prj>/prj.conf - Core project configuration
<wk>/<prj>/build - Builds
<wk>/<prj>/boards - Boards
<wk>/<prj>/boards/arm/<example>/ - a copy of the nrf5340dk configuration, renamed to something other than nrf5340dk to test if the build system handles custom boards differently than in-tree boards
<wk>/<prj>/child_image/b0/boards/<example>_cpuapp.conf

core project configuration includes the following:

CONFIG_NCS_SAMPLES_DEFAULTS=y
CONFIG_SECURE_BOOT=y
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y

The file <wk>/<prj>/child_image/b0/boards/<example>_cpuapp.conf must contain the contents of <wk>/nrf/samples/bootloader/prj.conf and <wk>/nrf/samples/bootloader/boards/nrf5340dk_nrf5340_cpuapp.conf or it will fail to build.

This relates to https://docs.nordicsemi.com/bundle/ncs-2.6.1/page/nrf/config_and_build/multi_image.html#permanent_configuration_changes_to_child_images

and  Compile ERROR "undefined reference to `sys_clock_cycle_get_32'" with custom board

Related