05 Sep, 2013

3 commits

  • Previously, it was possible to have more than one symbol with the
    'option modules' attached to them, although only the last one would
    in fact control tristates.

    Since this does not make much sense, only allow at most one symbol to
    control tristates.

    Note: it is still possible to have more than one symbol that control
    tristates, but indirectly:

    config MOD1
    bool "mod1"
    select MODULES
    config MOD2
    bool "mod2"
    select MODULES
    config MODULES
    bool
    option modules

    Signed-off-by: "Yann E. MORIN"
    Cc: Sam Ravnborg
    Signed-off-by: Michal Marek

    Yann E. MORIN
     
  • Regenerate bison parser after changes made in:
    6902dcc: kconfig: do not special-case 'MODULES' symbol

    Signed-off-by: "Yann E. MORIN"
    Cc: Sam Ravnborg
    Signed-off-by: Michal Marek

    Yann E. MORIN
     
  • Currently, the 'MODULES' symbol is hard-coded to be the default symbol
    that enables/disables tristates, if no other symbol was declared with
    'option modules'.

    While this used to be needed for the Linux kernel, we now have an
    explicit 'option modules' attached to the 'MODULES' symbol (since
    cset 11097a036), so we no longer need to special-case it in the
    kconfig code.

    Furthermore, kconfig is extensively used out of the Linux kernel, and
    other projects may have another meaning for a symbol named 'MODULES'.

    This patch changes the way we enable/disable tristates: if a symbol was
    found with 'option modules' attached to it, then that symbol controls
    enabling tristates. Otherwise, tristates are disabled, even if a symbol
    named 'MODULES' exists.

    Signed-off-by: "Yann E. MORIN"
    Cc: Sam Ravnborg
    Signed-off-by: Michal Marek

    Yann E. MORIN
     

16 Aug, 2013

2 commits

  • When a symbol changes type from tristate to bool, and was previously set to
    'm', a subsequent silentoldconfig would warn about inconsistency, such as:

    include/config/auto.conf:3014:warning: symbol value 'm' invalid for
    HOTPLUG_PCI_PCIE

    Seen by Linus with the merge in aa8032b (sequence to reproduce by Michal):
    git checkout 1fe0135
    make mrproper
    make allmodconfig
    make silentoldconfig
    git checkout aa8032b
    make allmodconfig
    make silentoldconfig

    Since HOTPLUG_PCI_PCIE changed from tristate to bool in aa8032b, it was
    previously set to 'm' in auto.conf by the first allmodconfig+silentoldconfig,
    but then was set to 'y' by the second allmodconfig. Then the second
    silentoldconfig prints the warning.

    The warning in this case is a spurious warning, which happens at the time
    kconfig tries to detect symbols that have changed, to touch the empty
    header files in include/config used for dependency-tracking by make.

    Silence the warning when we read the old auto.conf file, since it is
    perfectly legit that a symbol changed type since the previous call.

    Thread in:
    http://marc.info/?l=linux-pci&m=137569198904000&w=2

    Reported-by: Linus Torvalds
    Signed-off-by: "Yann E. MORIN"
    Cc: Linus Torvalds
    Cc: Michal Marek
    Cc: Thomas Petazzoni
    Cc: Bjorn Helgaas
    Cc: Yinghai Lu
    Cc: Benjamin Herrenschmidt

    Yann E. MORIN
     
  • Instead of using "long" for kconfig "hex" and "range" values, which may
    change in size depending on the host architecture, use "long long". This
    will allow values greater than INT_MAX on 32-bit hosts when cross
    compiling.

    Signed-off-by: Kees Cook
    Acked-by: Geert Uytterhoeven
    Tested-by: "Yann E. MORIN"
    Signed-off-by: "Yann E. MORIN"

    Kees Cook
     

23 Jul, 2013

1 commit


17 Jul, 2013

5 commits


11 Jul, 2013

1 commit

  • Pull kconfig updates from Michal Marek:
    - dependency solver fix for make defconfig
    - randconfig fixes, one of which had to be reverted again
    - more user-friendly sorting of search results
    - hex and range keywords support longs
    - fix for [mn]conf not to rely on particular behavior of the LINES and
    COLS variables
    - cleanup of magic constants in kconfig/lxdialog
    - [mn]conf formatting fixes
    - fix for scripts/config's help text in out-of-tree usage (under a
    different name)

    * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    kconfig: allow "hex" and "range" to support longs
    Revert "kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG"
    kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG
    kconfig: loop as long as we changed some symbols in randconfig
    kconfig/[mn]conf: make it explicit in the search box that a regexp is possible
    kconfig: sort found symbols by relevance
    kconfig/conf: print the seed used to initialise the RNG for randconfig
    kconfig/conf: accept a base-16 seed for randconfig
    kconfig/conf: fix randconfig setting multiple symbols in a choice
    scripts/config: replace hard-coded script name by a dynamic value
    mconf/nconf: mark empty menus/menuconfigs different from non-empty ones
    nconf: use function calls instead of ncurses' variables LINES and COLS
    mconf: use function calls instead of ncurses' variables LINES and COLS
    kconfig/lxdialog: handle newline characters in print_autowrap()
    kconfig/lxdialog: Use new mininimum resize definitions in conf_choice()
    kconfig/lxdialog: Add definitions for mininimum (re)size values
    kconfig: Fix defconfig when one choice menu selects options that another choice menu depends on

    Linus Torvalds
     

29 Jun, 2013

1 commit

  • The parsing routines for Kconfig files use strtol(), but store and
    render values as int. Switch types and formating to long to support a
    wider range of values. For example, 0x80000000 wasn't representable.

    Signed-off-by: Kees Cook
    Tested-by: "Yann E. MORIN"
    Reviewed-by: "Yann E. MORIN"
    Signed-off-by: "Yann E. MORIN"

    Kees Cook
     

26 Jun, 2013

1 commit


25 Jun, 2013

4 commits

  • Currently, randconfig does randomise choice entries, unless KCONFIG_ALLCONFIG
    is specified.

    For example, given those two files (Thomas' test-case):

    ---8
    Signed-off-by: "Yann E. MORIN"
    Cc: Thomas Petazzoni
    Cc: Michal Marek
    Cc: Sam Ravnborg
    Cc: Sedat Dilek
    Cc: Arnd Bergmann
    Cc: Stephen Rothwell

    ---
    Changes v3 -> v4
    - fix previous issue where some choices would not be set, which would
    cause silentoldconfig to ask for them and was then breaking this
    workflow (as reported by Arnd and Sedat):
    KCONFIG_ALLCONFIG=foo.defconfig make randconfig
    make silentoldconfig /dev/null 2>&1
    make silentoldconfig /dev/null 2>&1 || break
    done
    which did not break at all.
    - change done in v3 (below) is already fixed by a previous patch

    Changes v2 -> v3
    - ensure only one symbol is set in a choice

    Changes v1 -> v2:
    - further postpone setting that a choice has a value until
    one is indeed set
    - do not print symbols that are part of an invisible choice

    Yann E. MORIN
     
  • Because of choice-in-a-choice constructs, it can happen that not all
    symbols are assigned a value during randconfig, leading in rare cases
    to this situation:

    ---8 2. B (B)
    3. C (C)
    choice[1-3]: 2
    E/F
    > 1. E (E) (NEW)
    2. F (F) (NEW)
    choice[1-2]: aborted!

    Console input/output is redirected. Run 'make oldconfig' to update
    configuration.

    Fix this by looping in randconfig for as long as some symbol gets assigned
    a value.

    Note: this was spotted with the USB EHCI Debug Device Gadget (USB_G_DBGP),
    which uses this choice-in-a-choice construct, and exhibits this problem.
    The example above is just a stripped-down minimalist test-case.

    Signed-off-by: "Yann E. MORIN"

    Yann E. MORIN
     
  • Reported-by: Jean Delvare
    Signed-off-by: "Yann E. MORIN"
    Cc: Jean Delvare
    Cc: Michal Marek

    Yann E. MORIN
     
  • When searching for symbols, return the symbols sorted by relevance.

    Sorting is done as thus:
    - first, symbols that match exactly
    - then, alphabetical sort

    Since the search can be a regexp, it is possible that more than one symbol
    matches exactly. In this case, we can't decide which to sort first, so we
    fallback to alphabeticall sort.

    Explain this (new!) sorting heuristic in the documentation.

    Reported-by: Jean Delvare
    Signed-off-by: "Yann E. MORIN"
    Cc: Jean Delvare
    Cc: Michal Marek
    Cc: Roland Eggner
    Cc: Wang YanQing

    --
    Changes v1->v2:
    - drop the previous, complex heuristic in favour of a simpler heuristic
    that is both easier to understand, *and* to maintain (Jean)
    - explain sorting heuristic in the doc (Jean)

    Yann E. MORIN
     

19 Jun, 2013

8 commits

  • ... so the user has a chance to reproduce a test-case.

    Signed-off-by: "Yann E. MORIN"

    Yann E. MORIN
     
  • Signed-off-by: "Yann E. MORIN"

    Yann E. MORIN
     
  • Currently, randconfig may set more than one symbol in a given choice.
    Given this config file:
    config A
    bool "A"
    if A
    choice
    bool "B/C/D"
    config B
    bool "B"
    config C
    bool "C"
    config D
    bool "D"
    endchoice
    endif # A

    Then randconfig generates such .config files (case where A is not set is not
    shown below for brevity), and where only the right-most .config is valid:
    CONFIG_A=y CONFIG_A=y CONFIG_A=y
    CONFIG_B=y CONFIG_B=y CONFIG_B=y
    CONFIG_C=y # CONFIG_C is not set # CONFIG_C is not set
    # CONFIG_D is not set CONFIG_D=y # CONFIG_D is not set

    That is, in a randomised choice, the first symbol is always selected,
    and at most one other symbol may be selected.

    This is due to symbol randomised in a choice not being properly flagged
    as having a value.

    Fix that by flagging those symbols adequately: have a user-defined value,
    and be not valid (to force recalculation of the symbol).

    Note: if the choice is not conditional, then the randomisation is properly
    done.

    Reported-by: Matthieu CASTET
    Signed-off-by: Matthieu CASTET
    [yann.morin.1998@free.fr: independently re-done the same patch as Matthieu,
    as pointed out by Sedat]
    Cc: Arnaud Lacombe
    Cc: Sedat Dilek
    Signed-off-by: "Yann E. MORIN"

    Yann E. MORIN
     
  • Submenus are sometimes empty and it would be nice if there is
    something that notifies us that we should not expect any content
    _before_ we enter a submenu.

    A new function menu_is_empty() was introduced and empty menus and
    menuconfigs are now marked by "----" as opposed to non-empty ones that
    are marked by "--->".

    This scheme was suggested by "Yann E. MORIN" .

    Signed-off-by: Dirk Gouders
    Tested-by: "Yann E. MORIN"
    Reviewed-by: "Yann E. MORIN"
    Signed-off-by: "Yann E. MORIN"

    Dirk Gouders
     
  • According to the documentation [1], LINES and COLS are initialized by
    initscr(); it does not say anything about the behavior when windows are
    resized.

    Do not rely on the current implementation of ncurses that updates
    these variables on resize, but use the propper function calls or macros
    to get window dimensions.

    The use of the variables in main() was OK, but for the sake of
    consistency it was modified to use the macro getmaxyx().

    [1] ncurses(3X)

    Signed-off-by: Dirk Gouders
    Reviewed-by: "Yann E. MORIN"
    [yann.morin.1998@free.fr: declare 'lines' and 'columns' on a single line]
    Signed-off-by: Yann E. MORIN

    Dirk Gouders
     
  • According to the documentation [1], LINES and COLS are initialized by
    initscr(); it does not say anything about the behavior when windows are
    resized.

    Do not rely on the current implementation of ncurses that updates
    these variables on resize, but use the propper function calls to get
    window dimensions.

    init_dialog() could make use of the variables, but for the sake of
    consistency we do not change it's current use of the macro getmaxyx().

    [1] ncurses(3X)

    Signed-off-by: Dirk Gouders
    Tested-by: "Yann E. MORIN"
    Reviewed-by: "Yann E. MORIN"
    Signed-off-by: Yann E. MORIN

    Dirk Gouders
     
  • When exiting menuconfig with unsaved changes, a dialog like
    the following is shown:

    Do you wish to save your new configuration ?
    to continue.

    The author of the dialog text specified a newline after the '?',
    and probably expected it to be processed, so let print_autowrap()
    handle newlines propperly.

    Also, reword that dialog's second phrase with a real sentence.

    Signed-off-by: Dirk Gouders
    Tested-by: "Yann E. MORIN"
    Reviewed-by: "Yann E. MORIN"
    [yann.morin.1998@free.fr: very slightly tweak the commit message]
    Signed-off-by: Yann E. MORIN

    Dirk Gouders
     
  • This is a cleanup which uses the proper (new) definitions and does
    not change current behaviour.

    Signed-off-by: Sedat Dilek
    Reviewed-by: "Yann E. MORIN"
    Tested-by: "Yann E. MORIN"
    Signed-off-by: "Yann E. MORIN"

    ---
    Yann had some more ideas on improvements:

    "What would be nice is an improvement that scales the choice window to
    the number of entries in the choice. If there are a lot of choice
    entries, then the choice popup grows in height (but does not overflow
    the screen of course). So, instead of seeing only 6 entries, we'd see
    as much as possible in the current screen.

    Ditto for the width: the popup adapts to the longest prompt (but does
    not overflow the screen either, of course), so prompts are not
    truncated."

    NOTE: This patch requires [1].

    [1] http://marc.info/?l=linux-kbuild&m=137128726917166&w=2

    Sedat Dilek
     

16 Jun, 2013

2 commits

  • Commit c8dc68ad0fbd ("kconfig/lxdialog: support resize") added support
    for resizing, but forgot to collect all hardcoded values at one single
    place.

    Also add a definition for the check for a minimum screen/window size
    of 80x19.

    [ ChangeLog v3:
    * Rename MENU_{HEIGTH,WIDTH}_MIN -> MENUBOX_{HEIGTH,WIDTH}_MIN
    ChangeLog v2:
    * Rename WIN_{HEIGTH,WIDTH}_MIN -> WINDOW_{HEIGTH,WIDTH}_MIN
    * Mention the check for a minimum screen/window size in the changelog
    * Add a comment above the block of new definitions ]

    Signed-off-by: Sedat Dilek
    Acked-by: Wang YanQing
    Tested-by: "Yann E. MORIN"
    Reviewed-by: "Yann E. MORIN"
    Signed-off-by: "Yann E. MORIN"

    Sedat Dilek
     
  • The defconfig and Kconfig combination below, which is based on 3.10-rc4
    Kconfigs, resulted in several options getting set to "m" instead of "y".

    defconfig.choice:
    ---8
    [yann.morin.1998@free.fr: add the resulting .config to commit log,
    remove unneeded USB_GADGET from the defconfig]
    Tested-by: "Yann E. MORIN"
    Reviewed-by: "Yann E. MORIN"
    Signed-off-by: Yann E. MORIN

    Arve Hjønnevåg
     

30 May, 2013

2 commits

  • menu_add_prop() applies upper menus' visibilities to actual prompts
    by AND-ing the prompts visibilities with the upper menus ones.

    This creates a further reference to the menu's visibilities and when
    the expression reduction functions do their work, they may remove or
    modify expressions that have multiple references, thus causing
    unpredictable side-effects.

    The following example Kconfig constructs a case where this causes
    problems: a menu and a prompt which's visibilities depend on the same
    symbol. When invoking mconf with this Kconfig and pressing "Z" we
    see a problem caused by a free'd expression still referenced by the
    menu's visibility:

    ------------------------------------------------------------------------
    mainmenu "Kconfig Testing Configuration"

    config VISIBLE
    def_bool n

    config Placeholder
    bool "Place holder"

    menu "Invisible"
    visible if VISIBLE

    config TEST_VAR
    bool "Test option" if VISIBLE

    endmenu
    ------------------------------------------------------------------------

    This patch fixes this problem by creating copies of the menu's
    visibility expressions before AND-ing them with the prompt's one.

    Signed-off-by: Dirk Gouders
    [yann.morin.1998@free.fr: move variable into its block-scope,
    keep lines
    Reviewed-by: "Yann E. MORIN"
    Signed-off-by: "Yann E. MORIN"

    Dirk Gouders
     
  • When entering an empty dialog, using the movement keys resulted in
    unexpected characters beeing displayed, other keys like "z" and "h"
    did not work as expected.

    This patch handles the movement keys as well as other keys, especially
    "z", "h" and "/".

    Signed-off-by: Dirk Gouders
    [yann.morin.1998@free.fr: keep lines
    Reviewed-by: "Yann E. MORIN"
    Signed-off-by: "Yann E. MORIN"

    Dirk Gouders
     

07 May, 2013

2 commits

  • Pull kconfig updates from Michal Marek:
    - use pkg-config to detect curses libraries
    - clean up the way curses headers are searched
    - Some randconfig fixes, of which one had to be reverted
    - KCONFIG_SEED for randconfig debugging
    - memuconfig memory leak plugged
    - menuconfig > breadcrumbs > navigation
    - xconfig compilation fix
    - Other minor fixes

    * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    kconfig: fix lists definition for C++
    Revert "kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG"
    kconfig: implement KCONFIG_PROBABILITY for randconfig
    kconfig: allow specifying the seed for randconfig
    kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG
    kconfig: do not override symbols already set
    kconfig: fix randconfig tristate detection
    kconfig/lxdialog: rationalise the include paths where to find {.n}curses{,w}.h
    menuconfig: Add "breadcrumbs" navigation aid
    menuconfig: Fix memory leak introduced by jump keys feature
    merge_config.sh: Avoid creating unnessary source softlinks
    kconfig: optionally use pkg-config to detect ncurses libs
    menuconfig: optionally use pkg-config to detect ncurses libs

    Linus Torvalds
     
  • Searching for PPC_EFIKA results in a segmentation fault, and it's
    because get_symbol_prop() returns NULL.

    In this case CONFIG_PPC_EFIKA is defined in arch/powerpc/platforms/
    52xx/Kconfig, so it won't be parsed if ARCH!=PPC, but menuconfig knows
    this symbol when it parses sound/soc/fsl/Kconfig:

    config SND_MPC52xx_SOC_EFIKA
    tristate "SoC AC97 Audio support for bbplan Efika and STAC9766"
    depends on PPC_EFIKA

    This bug was introduced by commit bcdedcc1afd6 ("menuconfig: print more
    info for symbol without prompts").

    Reported-and-tested-by: Borislav Petkov
    Signed-off-by: Li Zefan
    Tested-by: Libo Chen
    Reviewed-by: "Yann E. MORIN"
    Signed-off-by: Michal Marek
    Signed-off-by: Linus Torvalds

    Li Zefan
     

01 May, 2013

1 commit

  • When we search a config symbol, if it has no prompt the position of this
    symbol in the Kconfig file and it's dependencies are not printed. This
    can be inconvenient, especially when it's set to n and we want to find out
    why.

    the following is an example:

    before:

    Symbol: GENERIC_SMP_IDLE_THREAD [=y]
    Type : boolean
    Selected by: X86 [=y]

    after:

    Symbol: GENERIC_SMP_IDLE_THREAD [=y]
    Type : boolean
    Defined at arch/Kconfig:213
    Selected by: X86 [=y]

    Signed-off-by: Weng Meiling
    Signed-off-by: Libo Chen
    Cc: Michal Marek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wengmeiling
     

30 Apr, 2013

3 commits

  • A bug was reported that caused localmodconfig to not keep all the
    dependencies of ATH9K. This was caused by the kconfig file:

    In drivers/net/wireless/ath/Kconfig:

    ---
    if ATH_CARDS

    config ATH_DEBUG
    bool "Atheros wireless debugging"
    ---help---
    Say Y, if you want to debug atheros wireless drivers.
    Right now only ath9k makes use of this.

    source "drivers/net/wireless/ath/ath5k/Kconfig"
    source "drivers/net/wireless/ath/ath9k/Kconfig"
    source "drivers/net/wireless/ath/carl9170/Kconfig"
    source "drivers/net/wireless/ath/ath6kl/Kconfig"
    source "drivers/net/wireless/ath/ar5523/Kconfig"
    source "drivers/net/wireless/ath/wil6210/Kconfig"

    endif
    ---

    The current way kconfig works, it processes new source files after the
    first file is completed. It creates an array of new source config files
    and when the one file is finished, it continues with the next file.

    Unfortunately, this means that it loses the fact that the source file is
    within an "if" statement, and this means that each of these source file's
    configs will not have the proper dependencies set.

    As ATH9K requires ATH_CARDS set, the localmodconfig did not see that
    dependency, and did not enable ATH_CARDS. When the oldconfig was run, it
    forced ATH9K to be disabled.

    Link: http://lkml.kernel.org/r/alpine.DEB.2.02.1304291022320.9234@oneiric

    Cc: stable@vger.kernel.org # 3.8+
    Reported-by: Robert P. J. Day
    Tested-by: Robert P. J. Day
    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • When a config for a module is added to the list to save in the final
    config file, add a print to show what dependencies are used. This is
    useful to debug when a config is disabled by the make oldconfig after
    localmodconfig is finished.

    This print only appears if the environment variable LOCALMODCONFIG_DEBUG
    is defined.

    Signed-off-by: Steven Rostedt

    Steven Rostedt
     
  • The C++ compiler is more strict in that it refuses to assign
    a void* to a struct list_head*.

    Fix that by explicitly casting the poisonning constants.

    (Tested with all 5 frontends, now.)

    Reported-by: Randy Dunlap
    Signed-off-by: "Yann E. MORIN"
    Cc: Randy Dunlap
    Cc: Benjamin Poirier

    Yann E. MORIN
     

27 Apr, 2013

1 commit


25 Apr, 2013

3 commits

  • Currently the odds to set each symbol is (rounded):
    booleans: y: 50% n: 50%
    tristates: y: 33% m: 33% n: 33%

    Introduce a KCONFIG_PROBABILITY environment variable to tweak the
    probabilities (in percentage), as such:
    KCONFIG_PROBABILITY y:n split y:m:n split
    -----------------------------------------------------------------
    [1] unset or empty 50 : 50 33 : 33 : 34
    [2] N N : 100-N N/2 : N/2 : 100-N
    N:M N+M : 100-(N+M) N : M : 100-(N+M)
    N:M:L N : 100-N M : L : 100-(M+L)

    [1] The current behaviour is kept as default, for backward compatibility
    [2] The solution initially implemented by Peter for Buildroot, see:
    http://git.buildroot.org/buildroot/commit/?id=3435c1afb5

    Signed-off-by: Peter Korsgaard
    [yann.morin.1998@free.fr: add to Documentation/]
    Signed-off-by: "Yann E. MORIN"

    Yann E. MORIN
     
  • For reproducibility, it can be useful to be able to specify the
    seed to use to seed the RNG.

    Add a new KCONFIG_SEED environment variable which can be set to
    the seed to use:
    $ make KCONFIG_SEED=42 randconfig
    $ sha1sum .config
    70a128c8dcc61303069e1be352cce64114dfcbca .config
    $ make KCONFIG_SEED=42 randconfig
    $ sha1sum .config
    70a128c8dcc61303069e1be352cce64114dfcbca .config

    It's very usefull for eg. debugging the kconfig parser.

    Signed-off-by: "Yann E. MORIN"

    Yann E. MORIN
     
  • Currently, randconfig does randomise choice entries, unless KCONFIG_ALLCONFIG
    is specified.

    For example, given those two files (Thomas' test-case):

    ---8
    Signed-off-by: "Yann E. MORIN"
    Cc: Thomas Petazzoni
    Cc: Michal Marek
    Cc: Sam Ravnborg
    Cc: Arnaud Lacombe

    ---
    Changes v2 -> v3
    - ensure only one symbol is set in a choice

    Changes v1 -> v2:
    - further postpone setting that a choice has a value until
    one is indeed set
    - do not print symbols that are part of an invisible choice

    Yann E. MORIN