14 Aug, 2018

1 commit


25 Jul, 2018

1 commit


29 May, 2018

1 commit

  • To get access to environment variables, Kconfig needs to define a
    symbol using "option env=" syntax. It is tedious to add a symbol entry
    for each environment variable given that we need to define much more
    such as 'CC', 'AS', 'srctree' etc. to evaluate the compiler capability
    in Kconfig.

    Adding '$' for symbol references is grammatically inconsistent.
    Looking at the code, the symbols prefixed with 'S' are expanded by:
    - conf_expand_value()
    This is used to expand 'arch/$ARCH/defconfig' and 'defconfig_list'
    - sym_expand_string_value()
    This is used to expand strings in 'source' and 'mainmenu'

    All of them are fixed values independent of user configuration. So,
    they can be changed into the direct expansion instead of symbols.

    This change makes the code much cleaner. The bounce symbols 'SRCARCH',
    'ARCH', 'SUBARCH', 'KERNELVERSION' are gone.

    sym_init() hard-coding 'UNAME_RELEASE' is also gone. 'UNAME_RELEASE'
    should be replaced with an environment variable.

    ARCH_DEFCONFIG is a normal symbol, so it should be simply referenced
    without '$' prefix.

    The new syntax is addicted by Make. The variable reference needs
    parentheses, like $(FOO), but you can omit them for single-letter
    variables, like $F. Yet, in Makefiles, people tend to use the
    parenthetical form for consistency / clarification.

    At this moment, only the environment variable is supported, but I will
    extend the concept of 'variable' later on.

    The variables are expanded in the lexer so we can simplify the token
    handling on the parser side.

    For example, the following code works.

    [Example code]

    config MY_TOOLCHAIN_LIST
    string
    default "My tools: CC=$(CC), AS=$(AS), CPP=$(CPP)"

    [Result]

    $ make -s alldefconfig && tail -n 1 .config
    CONFIG_MY_TOOLCHAIN_LIST="My tools: CC=gcc, AS=as, CPP=gcc -E"

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Kees Cook

    Masahiro Yamada
     

28 May, 2018

1 commit

  • The localization support is broken and appears unused.
    There is no google hits on the update-po-config target.
    And there is no recent (5 years) activity related to the localization.

    So lets just drop this as it is no longer used.

    Suggested-by: Ulf Magnusson
    Suggested-by: Masahiro Yamada
    Signed-off-by: Sam Ravnborg
    Signed-off-by: Masahiro Yamada

    Sam Ravnborg
     

26 Mar, 2018

1 commit

  • Tracking the line number by hand is error-prone since you need to
    increment it in every \n matching pattern.

    If '%option yylineno' is set, flex defines 'yylineno' to contain the
    current line number and automatically updates it each time it reads a
    \n character. This is much more convenient although the lexer does
    not initializes yylineno, so you need to set it to 1 each time you
    start reading a new file, and restore it you go back to the previous
    file.

    I tested this with DEBUG_PARSE, and confirmed the same dump message
    was produced.

    I removed the perf-report option. Otherwise, I see the following
    message:
    %option yylineno entails a performance penalty ONLY on rules that
    can match newline characters

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

01 Mar, 2018

1 commit


10 Feb, 2018

1 commit


21 Jan, 2018

1 commit

  • menu_end_entry() is empty and completely unused as far as I can tell:

    $ git log -G menu_end_entry --oneline
    a02f057 [PATCH] kconfig: improve error handling in the parser
    1da177e Linux-2.6.12-rc2

    Last one is the initial Git commit, where menu_end_entry() is empty as
    well. I couldn't find anything that redefined it on Google either.

    It might be a debugging helper for setting a breakpoint after each
    config, menuconfig, and comment is parsed. IMO it hurts more than it
    helps in that case by making the parsing code look more complicated at a
    glance than it really is, and I suspect it doesn't get used much.

    Tested by running the Kconfiglib test suite, which indirectly verifies
    that the .config files generated by the C implementation for each
    defconfig file in the kernel stays the same.

    Signed-off-by: Ulf Magnusson
    Signed-off-by: Masahiro Yamada

    Ulf Magnusson
     

20 Aug, 2017

1 commit

  • It turns out that gperf-3.1 changed types in the generated code in ways
    that aren't even trivially detectable without having to generate a test-file.

    It's just not worth using tools and libraries from clowns that don't
    understand or care about compatibility. So get rid of gperf.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

25 Feb, 2015

3 commits


08 Apr, 2014

1 commit

  • "make allnoconfig" exists to ease testing of minimal configurations.
    Documentation/SubmitChecklist includes a note to test with allnoconfig.
    This helps catch missing dependencies on common-but-not-required
    functionality, which might otherwise go unnoticed.

    However, allnoconfig still leaves many symbols enabled, because they're
    hidden behind CONFIG_EMBEDDED or CONFIG_EXPERT. For instance, allnoconfig
    still has CONFIG_PRINTK and CONFIG_BLOCK enabled, so drivers don't
    typically get build-tested with those disabled.

    To address this, introduce a new Kconfig option "allnoconfig_y", used on
    symbols which only exist to hide other symbols. Set it on CONFIG_EMBEDDED
    (which then selects CONFIG_EXPERT). allnoconfig will then disable all the
    symbols hidden behind those.

    Signed-off-by: Josh Triplett
    Tested-by: Paul E. McKenney
    Cc: Michal Marek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Josh Triplett
     

25 Jun, 2013

1 commit

  • 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
     

16 Jun, 2013

1 commit


20 Nov, 2012

3 commits

  • (and get them out of the noise in the audit work)

    Signed-off-by: Alan Cox
    Signed-off-by: Michal Marek

    Alan Cox
     
  • Currently, the CONFIG_ prefix is hard-coded in the kconfig frontends
    executables. This means that two projects that use kconfig with
    different prefixes can not share the same kconfig frontends.

    Instead of hard-coding the prefix in the frontends, get it from the
    environment, and revert back to hard-coded value if not found.

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

    Yann E. MORIN
     
  • Currently, we get the CONFIG_ prefix via the CONFIG_ macro, which means
    the CONFIG_ prefix is hard-coded at compile time. This goes against
    having a run-time defined CONFIG_ prefix.

    Add a function that returns the CONFIG_ prefix to use (but keep the
    current hard-coded behavior, to be changed in a later patch).

    To avoid touching all the code that uses the CONFIG_ macro, we just
    undef it, and define it to be a call to the function.

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

    Yann E. MORIN
     

15 Jan, 2012

1 commit

  • Reinhard Tartler discovered a corner case of calling xfwrite() where the
    length of the string is zero.

    Arnaud Lacombe suggested to use assertion for the corner case, as
    fwrite(3) is currently used:

    1) in comment printers. Empty comment are not allowed.
    2) in a callback passed to expr_print(), where the string printed is
    either NULL OR non-empty.
    3) in the lexer, auto-generated, and unused.

    I feel using assertion is a good solution:

    1) It cleanly takes care of the above-mentioned corner case.
    2) It can be easily disabled by defining NDEBUG.
    3) It asserts xfwrite() is simply a wrapper for fwrite().

    Reported-by: Reinhard Tartler
    Signed-off-by: Arnaud Lacombe
    Signed-off-by: Jean Sacren
    Signed-off-by: Michal Marek

    Arnaud Lacombe
     

30 Jul, 2011

1 commit

  • * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: (25 commits)
    kconfig: Introduce IS_ENABLED(), IS_BUILTIN() and IS_MODULE()
    xconfig: Abort close if configuration cannot be saved
    kconfig: fix missing "0x" prefix from S_HEX symbol in autoconf.h
    kconfig/nconf: remove useless conditionnal
    kconfig/nconf: prevent segfault on empty menu
    kconfig/nconf: use the generic menu_get_ext_help()
    nconfig: Avoid Wunused-but-set warning
    kconfig/conf: mark xfgets() private
    kconfig: remove pending prototypes for kconfig_load()
    kconfig/conf: add command line options' description
    kconfig/conf: reduce the scope of `defconfig_file'
    kconfig: use calloc() for expr allocation
    kconfig: introduce specialized printer
    kconfig: do not overwrite symbol direct dependency in assignment
    kconfig/gconf: silent missing prototype warnings
    kconfig/gconf: kill deadcode
    kconfig: nuke LKC_DIRECT_LINK cruft
    kconfig: nuke reference to SWIG
    kconfig: add missing inclusion
    kconfig: add missing inclusion
    ...

    Fix up conflicts in scripts/kconfig/Makefile

    Linus Torvalds
     

04 Jul, 2011

1 commit


02 Jul, 2011

2 commits


01 Jul, 2011

1 commit

  • Make conf_write_symbol() grammar agnostic to be able to use it from different
    code path. These path pass a printer callback which will print a symbol's name
    and its value in different format.

    conf_write_symbol()'s job become mostly only to prepare a string for the
    printer. This avoid to have to pass specialized flag to generic
    functions

    Signed-off-by: Arnaud Lacombe
    [mmarek: rebased on top of de12518 (kconfig: autogenerated config_is_xxx
    macro)]
    Signed-off-by: Michal Marek

    Arnaud Lacombe
     

10 Jun, 2011

1 commit


07 Jun, 2011

1 commit


11 Jan, 2011

1 commit

  • * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
    nconf: handle comment entries within choice/endchoice
    kconfig: fix warning
    kconfig: Make expr_copy() take a const argument
    kconfig: simplify select-with-unmet-direct-dependency warning
    kconfig: add more S_INT and S_HEX consistency checks
    kconfig: fix `zconfdebug' extern declaration
    kconfig/conf: merge duplicate switch's case
    kconfig: fix typos
    kbuild/gconf: add dummy inline for bind_textdomain_codeset()
    kbuild/nconf: fix spaces damage
    kconfig: nuke second argument of conf_write_symbol()
    kconfig: do not define AUTOCONF_INCLUDED
    kconfig: the day kconfig warns about "select"-abuse has come

    Linus Torvalds
     

15 Dec, 2010

2 commits


22 Nov, 2010

1 commit


20 Sep, 2010

3 commits


13 Aug, 2010

2 commits


03 Aug, 2010

2 commits

  • savedefconfig will save a minimal config to a file
    named "defconfig".

    The config symbols are saved in the same order as
    they appear in the menu structure so it should
    be possible to map them to the relevant menus
    if desired.

    The implementation was tested against several minimal
    configs for arm which was created using brute-force.

    There was one regression related to default numbers
    which had their valid range further limited by another symbol.

    Sample:

    config FOO
    int "foo"
    default 4

    config BAR
    int "bar"
    range 0 FOO

    If FOO is set to 3 then BAR cannot take a value higher than 3.
    But the current implementation will set BAR equal to 4.

    This is seldomly used and the final configuration is OK,
    and the fix was non-trivial.
    So it was documented in the code and left as is.

    Signed-off-by: Sam Ravnborg
    Acked-by: Uwe Kleine-König
    Signed-off-by: Michal Marek

    Sam Ravnborg
     
  • Move logic to determine default for a choice to
    a separate function.
    No functional changes.

    Signed-off-by: Sam Ravnborg
    Signed-off-by: Michal Marek

    Sam Ravnborg
     

02 Feb, 2010

2 commits

  • This patch was inspired by the kernel projects page, where an ncurses
    replacement for menuconfig was mentioned (by Sam Ravnborg).

    Building on menuconfig, this patch implements a more modern look
    interface using ncurses and ncurses' satellite libraries (menu, panel,
    form). The implementation does not depend on lxdialog, which is
    currently distributed with the kernel.

    Signed-off-by: Nir Tzachar
    Signed-off-by: Michal Marek

    nir.tzachar@gmail.com
     
  • Help text for certain config options is very extensive (the text
    includes the names of all other options the option in question depends
    on). Long lines are not wrapped, making it impossible to see the list
    without scrolling horizontally.

    This patch adds some logic which wraps help screen lines at word
    boundaries to prevent truncating.

    Tested by running

    ARCH=powerpc make menuconfig O=/tmp/build

    which shows that the long lines are now wrapped, and

    ARCH=powerpc make xconfig O=/tmp/build

    to demonstrate that it still compiles and operates as expected.

    Signed-off-by: Vadim Bendebury
    Signed-off-by: Michal Marek

    Vadim Bendebury (вб)
     

10 Jun, 2009

1 commit