[U-Boot] [PATCH] Don't apply: tools: add a tool to move automatically CONFIGs from headers to defconfigs

Simon Glass sjg at chromium.org
Wed Mar 4 01:18:50 CET 2015


Hi Masahiro,

On 19 January 2015 at 05:12, Masahiro Yamada <yamada.m at jp.panasonic.com> wrote:
> This tool can move CONFIG macros from C headers (include/configs/*.h)
> to defconfigs (configs/*_defconfig) all over the boards.
>
> There are tons of CONFIGs in U-boot and moving them by hand is
> absolutely tool painful.  I wrote this script for my local use,
> so this patch might not clean enough to be applied to the code base.
> It might contain some bugs.
>
> Please do not apply this patch!
>
> This patch is here because Simon requested me to share it.
> See the discussion in here:
> http://lists.denx.de/pipermail/u-boot/2015-January/201556.html
>
> Usage:
>
> [1] Please run "git status" and make sure your git repository is clean.
>
> [2] Describe the CONFIG option you want move in the file "~/.moveconfig"
>
>   Say, you want to move CONFIG_CMD_NAND, for example.
>   In this case, the content of "~/.moveconfig" should be like this:
>
>   $ cat .moveconfig
>   CONFIG_CMD_NAND bool n y
>
>   - The first field is the name of the CONFIG.
>   - The second field is the type of the CONFIG such as "bool", "int", "hex", etc.
>   - The third value is the default value.
>     The value that is same as the default is omitted in each defconfig.
>     If the type of the CONFIG is bool, the default value must be either 'y' or 'n'.
>   - The forth field shows whether the CONFIG depends on CONFIG_SPL_BUILD.
>     For example, CONFIG_CMD_* makes sense only on the main-image.
>     (depends on !SPL_BUILD)  In this case, specify 'y' in the forth fields.
>     If the CONFIG should appear also on SPL, specify 'n' here.
>
> [4] Run "tools/moveconfig.py"
>
>   The log will be displayed like this
>
>   $ tools/moveconfig.py
>   Moving CONFIG_CMD_NAND (type: bool, default: n, no_spl: y) ...  (jobs: 8)
>   ms7750se                             : (default)
>   davinci_sonata                       : (default)
>   tk71                                 : y
>   db-mv784mp-gp                        : (default)
>   cm_t3517                             : y
>   P2041RDB_SDCARD                      : y
>         ...
>
>   The left-hand side field is the board[defconfig] name and the colon
>   is followed by the value of the CONFIG.
>
>   At the last stage, you will be asked like this:
>
>   Clean up CONFIG_CMD_NAND in headers? [y/n]:
>
>   If you say 'y' here, the defines in C headers will be removed.
>
> Enjoy!

Just a note to say that I used this tool to handle the BOOTSTAGE
patch. It worked very nicely, thank you.!

I don't think it would take much to get this into shape for applying.
What do you think?

>
> Signed-off-by: Masahiro Yamada <yamada.m at jp.panasonic.com>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Alexey Brodkin <abrodkin at synopsys.com>
> ---
>
>  tools/moveconfig.py | 439 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 439 insertions(+)
>  create mode 100755 tools/moveconfig.py
>

Regards,
Simon


More information about the U-Boot mailing list