30 Jan, 2018

1 commit

  • Recent GCC versions warn if the format string is not a literal
    because the compiler cannot check the argument validity at compile
    time.

    Commit 192bc6948b02 ("Fix GCC format-security errors and convert
    sprintfs.") blindly replaced sprintf() with strcpy(), including
    many cases where the format parameter is a string literal.

    For the kconfig change:

    sprintf(header, " ");

    ..., here the format parameter is a string literal " ", so it is
    definitely equivalent to:

    strcpy(header, " ");

    Of course, if the 'header' did not have enough length for containing
    " ", it would be a security problem, but another problem. (in this
    case, the 'header' is 4 byte length buffer, so it is not a problem at
    all.)

    The kconfig code is kept as synced with Linux as possible, but this
    change made the code out-of-sync for nothing. Just reverting.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

21 Nov, 2017

1 commit


13 Feb, 2017

1 commit

  • Re-sync all files under the scripts/kconfig directory with
    Linux 4.10.

    Some parts include U-Boot own modification. I made sure to not
    revert the following commits:

    5b8031ccb4ed ("Add more SPDX-License-Identifier tags")
    192bc6948b02 ("Fix GCC format-security errors and convert sprintfs.")
    da58dec86616 ("Various Makefiles: Add SPDX-License-Identifier tags")
    20c20826efab ("Kconfig: Enable usage of escape char '\' in string values")

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

19 Jan, 2016

1 commit

  • In a number of places we had wordings of the GPL (or LGPL in a few
    cases) license text that were split in such a way that it wasn't caught
    previously. Convert all of these to the correct SPDX-License-Identifier
    tag.

    Signed-off-by: Tom Rini

    Tom Rini
     

15 Jan, 2016

1 commit


10 Nov, 2015

1 commit

  • After consulting with some of the SPDX team, the conclusion is that
    Makefiles are worth adding SPDX-License-Identifier tags too, and most of
    ours have one. This adds tags to ones that lack them and converts a few
    that had full (or in one case, very partial) license blobs into the
    equivalent tag.

    Cc: Kate Stewart
    Signed-off-by: Tom Rini

    Tom Rini
     

28 Jul, 2015

1 commit

  • Update the files under scripts/kconfig/ to match Linux 4.1.
    Some Kconfig sources have diverged from those in the kernel,
    so commit-base syncing was done not to lose U-Boot specific updates.

    The commits cherry-picked from Linux are:

    [1] commit be8af2d54a66911693eddc556e4f7a866670082b
    Author: Bjørn Forsman
    kconfig/lxdialog: get ncurses CFLAGS with pkg-config

    [2] commit 3943f42c11896ce82ad3da132c8a5630313bdd0e
    Author: Andrey Utkin
    Replace mentions of "list_struct" to "list_head"

    [3] commit e4e458b45c5861808674eebfea94cee2258bb2ea
    Author: Arjun Sreedharan
    calloc/xcalloc: Fix argument order

    [4] commit 09950bc256e3628d275f90e016e6f5a039fbdcab
    Author: Olof Johansson
    merge_config.sh: Display usage if given too few arguments

    [5] commit b6a2ab2cd4739a9573ed41677e53171987b8da34
    Author: Colin Ian King
    kconfig: use va_end to match corresponding va_start

    [6] commit 70529b1a1784503169416df19ce3d68746401340
    Author: Michal Marek
    kconfig: Get rid of the P() macro in headers

    [7] commit 463157444e377bf9b279101b1f16a94c4648c03a
    Author: Michal Marek
    kconfig: Remove dead code

    [8] commit ad8d40cda3ad22ad9e8863d55a5c88f85c0173f0
    Author: Michal Marek
    kconfig: Remove unnecessary prototypes from headers

    [9] commit de4619937229378e81f95e99c9866acc8e207d34
    Author: Masahiro Yamada
    kbuild: mergeconfig: fix "jobserver unavailable" warning

    [10] commit b9fe99c5b994c6ddc57780993966b18899526c0b
    Author: Masahiro Yamada
    kbuild: mergeconfig: move an error check to merge_config.sh

    [11] commit 371cfd4ff0611d8bc5d18bbb9cc6a2bc3d56cd3d
    Author: Masahiro Yamada
    kbuild: mergeconfig: remove redundant $(objtree)

    [12] commit 3a975b8cfcbe026b535f83bde9a3c009bae214f9
    Author: Masahiro Yamada
    merge_config.sh: improve indentation

    [13] commit bc8f8f5fc47cd02c2c5f3580dac2fe6695af1edd
    Author: Masahiro Yamada
    merge_config.sh: rename MAKE to RUNMAKE

    [14] commit 63a91033d52e64a22e571fe84924c0b7f21c280d
    Author: Masahiro Yamada
    kbuild: add generic mergeconfig target, %.config

    [15] commit 1cba0c305758c3c1786ecaceb03e142c95a4edc9
    Author: Michal Marek
    kconfig: Simplify Makefile

    [16] commit 0a1f00a1c86421cc07cec87011c7cf4df68ee54b
    Author: Michal Marek
    kconfig: Do not print status messages in make -s mode

    Signed-off-by: Masahiro Yamada
    Signed-off-by: Bjørn Forsman
    Signed-off-by: Andrey Utkin
    Signed-off-by: Jiri Kosina
    Signed-off-by: Arjun Sreedharan
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Olof Johansson
    Signed-off-by: Colin Ian King
    Signed-off-by: Michal Marek

    Masahiro Yamada
     

08 Jun, 2015

1 commit

  • I might have missed something, but I failed to use the escape char '\'
    in strings. To pass a printf format string like "foo %d bar\n" via
    Kconfig to the code.

    Right now its not possible to use the escape character '\' in Kconfig
    string values correctly to e.g. set this string value "test output\n".
    The '\n' will be converted to 'n'.

    The current implementation removes some of the '\' chars from the input
    string in conf_set_sym_val(). Examples:

    '\' -> ''
    '\\' -> '\'
    '\\\' -> '\'
    '\\\\' -> '\\'
    ...

    And then doubles the backslash chars in the output string in
    sym_escape_string_value(). Example:

    '\' -> '' -> ''
    '\\' -> '\' -> '\\'
    '\\\' -> '\' -> '\\'
    '\\\\' -> '\\' -> '\\\\'
    ...

    As you see in these examples, its impossible to generate a single '\'
    charater in the output string as its needed for something like '\n'.

    This patch now changes this behavior to not drop some backslashes in
    conf_set_sym_val() and to not add new backslashes in the resulting
    output string. Removing the function sym_escape_string_value()
    completely as its not needed anymore.

    Signed-off-by: Stefan Roese
    Cc: Masahiro Yamada
    Reviewed-by: Simon Glass
    Cc: Tom Rini

    Stefan Roese
     

28 Mar, 2015

1 commit

  • We have switched to the single .config configuration system,
    the same one as used in Linux Kernel.

    The necessary glue code is small enough now, so move it to the
    top-level Makefile and scripts/kconfig/Makefile, and then delete
    scripts/multiconfig.sh.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Simon Glass

    Masahiro Yamada
     

02 Mar, 2015

1 commit


08 Dec, 2014

1 commit

  • Warning:
    In file included from scripts/kconfig/zconf.tab.c:2537:0:
    scripts/kconfig/menu.c: In function ‘get_symbol_str’:
    scripts/kconfig/menu.c:590:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    jump->offset = strlen(r->s);

    Simplifies the test logic because (head && local) means (jump != 0)
    and makes GCC happy when checking if the jump pointer was initialized.

    Signed-off-by: Peter Kümmel
    Signed-off-by: Michal Marek
    [ imported from Linux Kernel, commit 2d5603060967 ]
    Signed-off-by: Masahiro Yamada

    Peter Kümmel
     

13 Nov, 2014

1 commit

  • The Makefiles call the respective interpreter explicitly, but this makes
    it easier to use the scripts manually.

    (This commit follows commit 06ed5c2bfaca of Linux Kernel)

    Signed-off-by: Michal Marek
    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

08 Nov, 2014

2 commits

  • This commit imports Kconfig updates from Linux 3.18-rc1.

    'kvmconfig' and 'tinyconfig' help message have been commented out
    since they are unavailable at least now; in the future perhaps
    we can implement 'tinyconfig' to disable most of CONFIG_CMD_* to
    create a very small U-Boot image.

    [1] commit 3aaefce10351 by Josh Triplett
    x86, platform, kconfig: move kvmconfig functionality to a helper

    [2] commit 0da1d4a0b951 by Josh Triplett
    x86: Add "make tinyconfig" to configure the tiniest possible kernel

    [3] commit c40724d3f381 by Brian Norris
    kconfig: lxdialog: fix spelling

    [4] commit 7285996aa000 by Brian Norris
    kconfig: nconfig: fix multi-byte UTF handling

    Signed-off-by: Josh Triplett
    Signed-off-by: Brian Norris
    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • Since Linux 3.18-rc1, Kbuild is able to handle multi-objs
    dependency correctly, which also allows us futher cleanups
    of some makefiles.

    This commit imports those commits:

    [1] commit c8589d1e9e01 by Masahiro Yamada
    kbuild: handle multi-objs dependency appropriately

    [2] commit 97e3226e6e98 by Masahiro Yamada
    kbuild: handle the dependency of multi-objs hostprogs appropriately

    [3] commit 022af62d0190 by Masahiro Yamada
    kbuild: refactor script/kconfig/Makefile

    [4] commit 221ecca6cafe by Masahiro Yamada
    kbuild: remove redundant clean-files from scripts/kconfig/Makefile

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

28 Oct, 2014

1 commit


30 Jul, 2014

2 commits

  • This commit enables Kconfig.
    Going forward, we use Kconfig for the board configuration.
    mkconfig will never be used. Nor will include/config.mk be generated.

    Kconfig must be adjusted for U-Boot because our situation is
    a little more complicated than Linux Kernel.
    We have to generate multiple boot images (Normal, SPL, TPL)
    from one source tree.
    Each image needs its own configuration input.

    Usage:

    Run "make _defconfig" to do the board configuration.

    It will create the .config file and additionally spl/.config, tpl/.config
    if SPL, TPL is enabled, respectively.

    You can use "make config", "make menuconfig" etc. to create
    a new .config or modify the existing one.

    Use "make spl/config", "make spl/menuconfig" etc. for spl/.config
    and do likewise for tpl/.config file.

    The generic syntax of configuration targets for SPL, TPL is:

    /

    Here, is either 'spl' or 'tpl'
    is 'config', 'menuconfig', 'xconfig', etc.

    When the configuration is done, run "make".
    (Or "make _defconfig all" will do the configuration and build
    in one time.)

    For futher information of how Kconfig works in U-Boot,
    please read the comment block of scripts/multiconfig.py.

    By the way, there is another item worth remarking here:
    coexistence of Kconfig and board herder files.

    Prior to Kconfig, we used C headers to define a set of configs.

    We expect a very long term to migrate from C headers to Kconfig.
    Two different infractructure must coexist in the interim.

    In our former configuration scheme, include/autoconf.mk was generated
    for use in makefiles.
    It is still generated under include/, spl/include/, tpl/include/ directory
    for the Normal, SPL, TPL image, respectively.

    Signed-off-by: Masahiro Yamada
    Acked-by: Simon Glass

    Masahiro Yamada
     
  • Import
    - scripts/kconfig/*
    - include/linux/kconfig.h
    from Linux 3.16-rc7.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Simon Glass

    Masahiro Yamada