1

I was in the middle of adding a new board to Yocto while I noticed that a lot of the configuration could be inherited from the previous hw revision.

So I was wondering if there could be the possibility of including a common_defconfig in the <new_board>_defconfig to not duplicate all the configuration files. Similarly to what happens with dts files.

E.g.

common_defconfig:

CONFIG_ARM=y
CONFIG_SPL=y
CONFIG_CMD_I2C=y

board_hw1_defconfig:

#include "common_defconfig"
CONFIG_TARGET_BOARD_HW1=y

board_hw2_defconfig:

#include "common_defconfig"
CONFIG_TARGET_BOARD_HW2=y

UPDATE 1

Like pointed out by @Xypron, and as I was suspecting, there is no way to include different _defconfig one in another.

I also tried to create a generic Kconfig.defconfig to select some configurations. The problem was that, for example, ARM is defined as a config inside a choice so cannot be selected from inside a Kconf file.

I will end up creating a do_configure_append task where I will merge the _defconfig files through the use of scripts/kconfig/merge_config.sh if no one will come with a better solution.

garlix
  • 576
  • 9
  • 26

1 Answers1

2

U-Boot inherits the build system from Linux. Neither of both support includes in _defconfig-files up to now. If you want it changed you need to come up with a patch for scripts/kconfig/Makefile scripts/kconfig/Makefile.

The configs/*defconfig files are seeding .config. So anyway most of the configuration comes from presets in the Kconfig files. This is different to the device trees where for ARM systems all values come from *.dts and *.dtsi files.

Xypron
  • 2,215
  • 1
  • 12
  • 24