[U-Boot] [PATCH v3 07/10] moveconfig: Ignore duplicate configs when moving

Joe Hershberger joe.hershberger at gmail.com
Thu May 14 20:02:58 CEST 2015


Hi Masahiro-san,

On Thu, May 14, 2015 at 10:36 AM, Masahiro Yamada
<yamada.masahiro at socionext.com> wrote:
> 2015-05-14 7:28 GMT+09:00 Joe Hershberger <joe.hershberger at ni.com>:
>> When moving configs, it is important to know what was defined in the
>> config header even if it duplicates the configs coming from Kconfig.
>>
>> 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 at ni.com>
>>
>> ---
>>
>> Changes in v3:
>> -New for version 3
>>
>> Changes in v2: None
>>
>>  scripts/Makefile.autoconf | 3 ++-
>>  tools/moveconfig.py       | 1 +
>>  2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/scripts/Makefile.autoconf b/scripts/Makefile.autoconf
>> index f054081..36bfa17 100644
>> --- a/scripts/Makefile.autoconf
>> +++ b/scripts/Makefile.autoconf
>> @@ -58,7 +58,8 @@ quiet_cmd_autoconf = GEN     $@
>>         $(CPP) $(c_flags) $2 -DDO_DEPS_ONLY -dM $(srctree)/include/common.h > $@.tmp && { \
>>                 sed -n -f $(srctree)/tools/scripts/define2mk.sed $@.tmp |               \
>>                 while read line; do                                                     \
>> -                       if ! grep -q "$${line%=*}=" include/config/auto.conf; then      \
>> +                       if [ -n "${KCONFIG_IGNORE_DUPLICATES}" ] ||                     \
>> +                          ! grep -q "$${line%=*}=" include/config/auto.conf; then      \
>>                                 echo "$$line";                                          \
>>                         fi                                                              \
>>                 done > $@;                                                              \
>> diff --git a/tools/moveconfig.py b/tools/moveconfig.py
>> index 9135e1d..97ff597 100755
>> --- a/tools/moveconfig.py
>> +++ b/tools/moveconfig.py
>> @@ -340,6 +340,7 @@ class Slot:
>>          cmd = list(self.make_cmd)
>>          if self.cross_compile:
>>              cmd.append('CROSS_COMPILE=%s' % self.cross_compile)
>> +        cmd.append('KCONFIG_IGNORE_DUPLICATES=1')
>>          cmd.append('include/autoconf.mk')
>>          self.ps = subprocess.Popen(cmd, stdout=self.devnull, stderr=PIPE)
>>          self.state = STATE_SILENTOLDCONFIG
>
>
> This patch is not clear to me.

This was specifically a problem when moving a config that defaulted to
true in the Kconfig. That meant that it would be "duplicate removed"
from the include since it was already true (by default) in the
Kconfig. So it had the effect of disabling that config in every board.
This stops the filtering in the case where we are trying to move
configs instead of trying to build the board in this mixed config
system environment.

> Isn't it the same concept as u-boot.cfg
> instroduced by commit 741e58e0fc8.

I don't believe it is the same thing because this will still include
the configs enabled through the config header, but (I think) not those
from Kconfig.  And anyway, we are evaluating autoconf.mk, not
u-boot.cfg.

Cheers,
-Joe


More information about the U-Boot mailing list