Commit 7740f653e6b3634383603e31ad2f3decac8becf1

Authored by Joe Hershberger
Committed by Masahiro Yamada
1 parent 96464badc7

moveconfig: Ignore duplicate configs when moving

When moving configs, it is important to know what was defined in the
config header even if it duplicates the configs coming from Kconfig.

This is specifically needed for the case where a config is set to
default 'y' in the Kconfig. This would previously cause the actual value
from the include config to be filtered out, and moveconfig.py would
think that it was 'n'... This means that the value that should be 'y'
is now (in every defconfig) set to 'not set'.

tools/moveconfig.py now defines KCONFIG_IGNORE_DUPLICATES to prevent the
filtering from happening and selecting wrong values for the defconfig.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Showing 2 changed files with 3 additions and 1 deletions Side-by-side Diff

scripts/Makefile.autoconf
... ... @@ -58,7 +58,8 @@
58 58 $(CPP) $(c_flags) $2 -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && { \
59 59 sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp | \
60 60 while read line; do \
61   - if ! grep -q "$${line%=*}=" include/config/auto.conf; then \
  61 + if [ -n "${KCONFIG_IGNORE_DUPLICATES}" ] || \
  62 + ! grep -q "$${line%=*}=" include/config/auto.conf; then \
62 63 echo "$$line"; \
63 64 fi \
64 65 done > $@; \
... ... @@ -628,6 +628,7 @@
628 628 cmd = list(self.make_cmd)
629 629 if cross_compile:
630 630 cmd.append('CROSS_COMPILE=%s' % cross_compile)
  631 + cmd.append('KCONFIG_IGNORE_DUPLICATES=1')
631 632 cmd.append('include/config/auto.conf')
632 633 self.ps = subprocess.Popen(cmd, stdout=self.devnull)
633 634 self.state = STATE_AUTOCONF