
On Thu, May 19, 2016 at 1:51 AM, Masahiro Yamada yamada.masahiro@socionext.com wrote:
Since 96464badc794 ("moveconfig: Always run savedefconfig on the moved config"), this tool can not correctly move bool configs with the default value y.
The reason is like follows:
We are supposed to add the config entries in Kconfig for the options we are moving before running this tool. Otherwise, the moved options would all disappear during the "make savedefconfig" stage.
Let's say we want to move CONFIG_FOO to Kconfig, making it an option with "default y". The first thing we need to do is to create an entry like follows:
config FOO bool "foo" default y
So, CONFIG_FOO=y will be set in the .config for every defconfig.
Commit 7740f653e6b3 ("moveconfig: Ignore duplicate configs when moving") introduced KCONFIG_IGNORE_DUPLICATES to fix the false negative (= boards that should be converted to "=y" are misconverted to "not set") problem. With that commit, the CONFIGs in the .config are now duplicated to include/autoconf.mk unless they are defined to a different value or #undef'ed in the board header. It causes false positive problem this time; boards without #define/#undef CONFIG_FOO in their header should be converted to "not set", but misconverted to "=y" actually.
This commit intends to handle such cases correctly. Anyway, we need to create a Kconfig entry beforehand to persevere savedefconfig. But, we do not want to propagate CONFIGs coming from "default y" to the include/autoconf.mk. To achieve it, the new option --undef is here!
We can move bool option with default y in this way:
- create an entry in Kconfig
- run "tools/moveconfig.py --undef=CONFIG_FOO CONFIG_FOO"
This seems tedious to use. The way I solved this didn't require any extra specification of what was expected to happen.
http://lists.denx.de/pipermail/u-boot/2015-June/215724.html
This option can appear multiple times in the command line, so that we can move multiple options at a time.
Signed-off-by: Masahiro Yamada yamada.masahiro@socionext.com