20 Aug, 2010

1 commit


15 Aug, 2010

2 commits

  • Following sample Kconfig generated a segfault:

    config FOO
    bool
    select PERF_EVENTS if HAVE_HW_BREAKPOINT

    config PERF_EVENTS
    bool

    config HAVE_HW_BREAKPOINT
    bool
    depends on PERF_EVENTS

    Fix by reverting back to a valid property if there was no
    property on the stack of symbols.

    The above pattern were seen in sh Kconfig.
    A fix for the Kconfig file has been sent to the sh folks.

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

    Sam Ravnborg
     
  • savedefconfig failed to save the correct minimal config
    when it encountered a choice marked optional.

    Consider following minimal configuration:
    $cat Kconfig
    choice
    prompt "choice"
    optional

    config A
    bool "a"

    config B
    bool "b"

    endchoice

    $cat .config | grep -v ^#
    CONFIG_A=y

    $conf --savedefconfig=defconfig Kconfig

    would before this fix result in an empty file, because
    kconfig would assume that CONFIG_A=y is a default value.
    But because the choice is optional the default is that
    both A and B are =n.

    Fix so we handle optional choices correct.

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

    Sam Ravnborg
     

14 Aug, 2010

1 commit


13 Aug, 2010

3 commits


12 Aug, 2010

2 commits

  • If a minimal config did not specify the value
    of all choice values, the resulting configuration
    could have wrong values.

    Consider following example:
    config M
    def_bool y
    option modules
    choice
    prompt "choice list"
    config A
    tristate "a"
    config B
    tristate "b"
    endchoice

    With a defconfig like this:
    CONFIG_M=y
    CONFIG_A=y

    The resulting configuration would have

    CONFIG_A=m

    which was unexpected.

    The problem was not not all choice values were set and thus
    kconfig calculated a wrong value.

    The fix is to set all choice values when we
    read a defconfig files.

    conf_set_all_new_symbols() is refactored such that
    random choice values are now handled by a dedicated function.
    And new choice values are set by set_all_choice_values().

    This was not the minimal fix, but the fix that resulted
    in the most readable code.

    Signed-off-by: Sam Ravnborg
    Reported-by: Arve Hjønnevåg
    Tested-by: Arve Hjønnevåg
    Signed-off-by: Michal Marek

    Sam Ravnborg
     
  • savedefconfig failed to save choice symbols equal to 'y'
    for tristate choices.
    This resulted in this value being lost.

    In particular is fixes an issue where

    make ARCH=avr32 atngw100_defconfig
    make ARCH=avr32 savedefconfig
    cp defconfig arch/avr32/configs/atngw100_defconfig
    make ARCH=avr32 atngw100_defconfig
    diff -u .config .config.old

    failed to produce an identical .config.

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

    Sam Ravnborg
     

07 Aug, 2010

1 commit

  • Linus wrote:
    This seems to make "make oldconfig" a _lot_ more verbose than it
    used to be. In a very annoying way.

    I just did a quick git bisect. It's introduced by commit 4062f1a4c030
    ("kconfig: use long options in conf") by Sam Ravnborg. Apparently that
    thing is totally buggy, and doesn't just change the option names, but
    actively breaks them.

    The old behaviour (from years ago) were reintroduced by accident. Fix
    this so we are back to the version that are silent if there is nothing
    to ask about.

    Reported-by: Linus Torvalds
    Signed-off-by: Sam Ravnborg
    Reviewed-by: Michal Marek
    Signed-off-by: Linus Torvalds

    Sam Ravnborg
     

06 Aug, 2010

1 commit

  • * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
    scripts/dtc: Fix a resource leak
    Documentation: fix ubuntu distro name
    MAINTAINERS: Update kbuild git URLs
    Add support for the C variable in the coccicheck script
    Add scripts/coccinelle/deref_null.cocci
    Add scripts/coccinelle/err_cast.cocci
    Add scripts/coccinelle/resource_size.cocci
    Add scripts/coccinelle/alloc/kzalloc-simple.cocci
    Add scripts/coccinelle/alloc/drop_kmalloc_cast.cocci
    Add Documentation/coccinelle.txt
    Add a target to use the Coccinelle checker
    scripts: decodecode: remove bashisms
    Makefile: clarify a comment
    checkkconfigsymbols.sh: Kconfig symbols sometimes have lowercase letters
    scripts: add nconf into gitignore file

    Linus Torvalds
     

04 Aug, 2010

1 commit


03 Aug, 2010

9 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
     
  • Add a a few local functions to avoid some code duplication
    No functional changes.

    Signed-off-by: Sam Ravnborg
    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
     
  • alldefconfig create a configuration with all values set
    to their default value (form the Kconfig files).

    This may be useful when we try to use more sensible default
    values and may also be used in combination with
    the minimal defconfigs.

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

    Sam Ravnborg
     
  • Consider following kconfig file:

    config TEST1
    bool "test 1"
    depends on TEST2

    config TEST2
    bool "test 2"
    depends on TEST1

    Previously kconfig would report:

    foo:6:error: found recursive dependency: TEST2 -> TEST1 -> TEST2

    With the following patch kconfig reports:
    foo:5:error: recursive dependency detected!
    foo:5: symbol TEST2 depends on TEST1
    foo:1: symbol TEST1 depends on TEST2

    Note that we now report where the offending symbols are defined.
    This can be a great help for complex situations involving
    several files.

    Patch is originally from Roman Zippel with a few adjustments by Sam.

    Signed-off-by: Sam Ravnborg
    Cc: Roman Zippel
    Signed-off-by: Michal Marek

    Roman Zippel
     
  • When we add a new config symbol save the file/line
    so we later can refer to their location.

    The information is saved as a property to a config symbol
    because we may have multiple definitions of the same symbol.

    This has the side-effect that a symbol always has
    at least one property.

    Signed-off-by: Sam Ravnborg
    Cc: Roman Zippel
    Signed-off-by: Michal Marek

    Sam Ravnborg
     
  • Rename to a name that better match the other kconfig targets.

    listnewconfig shall read as:

    - list new options compared to current configuration

    New options are now written to stdout so one can redirect the output.

    Do not exit with an error code if there is new options.

    These are feature changes compared to the original
    nonint_oldconfig - but as this feature has not yet been in a
    released kernel it should not matter.

    It is still possible to do:

    make listnewconfig
    lookup new config options in Kconfig*
    edit .config

    Signed-off-by: Sam Ravnborg
    Cc: Aristeu Rozanski
    Acked-by: Aristeu Rozanski
    Signed-off-by: Michal Marek

    Sam Ravnborg
     
  • Rename target to something that fall more in line
    with the other kconfig targets.

    oldnoconfig shall read as:

    - read the old configuration and set all new options to no

    Signed-off-by: Sam Ravnborg
    Cc: Aristeu Rozanski
    Signed-off-by: Michal Marek

    Sam Ravnborg
     
  • The list of options supported by conf is growing
    and their abbreviation did not resemble anything usefull.

    So drop the single letter options in favour of long options.

    The long options are named equal to what we know from
    the make target.
    The internal implmentation was changed to match this,
    resulting in much more readable code.

    Support for short options is dropped - no one is supposed
    to call this program direct anyway.

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

    Sam Ravnborg
     

29 Jul, 2010

1 commit

  • There seems to be a kconfig bug due to MODULES not always being
    evaluated if no .config is found. Take the following Kconfig as an
    example:

    config MODULES
    def_bool y

    config FOO
    def_tristate m

    With no .config, the following configuration is generated:

    CONFIG_MODULES=y
    CONFIG_FOO=y

    With an empty .config, the following:

    CONFIG_MODULES=y
    CONFIG_FOO=m

    Tristate choice statements can also exhibit the problem, due to having an
    implicit rev_dep (select) containing "m".

    The problem is that MODULES is never evaluted in conf_read_simple() unless
    there's a .config. The following patch fixes this.

    Signed-off-by: Ulf Magnusson
    Reviewed-by: WANG Cong
    Signed-off-by: Michal Marek

    Ulf Magnusson
     

26 Jul, 2010

1 commit


23 Jul, 2010

1 commit

  • nconfig segfaults when help text contains the character '%'. For a quick
    example, navigate to the kernel compression options and get the help for
    bzip2. Doing so triggers a call to mvwprintw() with a string containing
    '%' and no extra arguments to fill in the specifier's value. Fix this
    case by printing the literal string retrieved from the kconfig.

    #0 0x00002b52b6b11d83 in vfprintf () from /lib/libc.so.6
    #1 0x00002b52b6bad010 in __vsnprintf_chk () from /lib/libc.so.6
    #2 0x00002b52b623991b in _nc_printf_string () from
    /lib/libncursesw.so.5
    #3 0x00002b52b6234cff in vwprintw () from /lib/libncursesw.so.5
    #4 0x00002b52b6234db9 in mvwprintw () from /lib/libncursesw.so.5
    #5 0x00000000004151d8 in fill_window (win=0x21b64c0,
    text=0x21b62b0 "CONFIG_KERNEL_BZIP2:\n\nIts compression ratio and
    speed is intermediate.\nDecompression speed is slowest among the
    three. The kernel\nsize is about 10% smaller with bzip2, in
    comparison to gzip.\nBzip2 us"...)
    at scripts/kconfig/nconf.gui.c:229
    #6 0x0000000000416335 in show_scroll_win (main_window=0x21a5630,
    title=0x157fa30 "Bzip2",
    text=0x21b62b0 "CONFIG_KERNEL_BZIP2:\n\nIts compression
    ratio and speed is intermediate.\nDecompression speed is
    slowest among the three. The kernel\nsize is about 10%
    smaller with bzip2, in comparison to gzip.\nBzip2 us"...)
    at scripts/kconfig/nconf.gui.c:535
    #7 0x00000000004055b2 in show_help (menu=0x157f9d0)
    at scripts/kconfig/nconf.c:1257
    #8 0x0000000000405897 in conf_choice (menu=0x157f130)
    at scripts/kconfig/nconf.c:1321
    #9 0x0000000000405326 in conf (menu=0x157d130) at
    scripts/kconfig/nconf.c:1208
    #10 0x00000000004052e8 in conf (menu=0xb434a0) at
    scripts/kconfig/nconf.c:1203
    #11 0x0000000000406092 in main (ac=2, av=0x7fff96a93c38)

    Cc: Michal Marek
    Cc: Nir Tzachar
    Signed-off-by: Stephen Boyd
    Signed-off-by: Michal Marek

    Stephen Boyd
     

08 Jul, 2010

1 commit

  • This makes it so "make oldconfig" really prompts for any choice where
    options that previously weren't visible just became so. Previously one
    would have to remember to go over all choice values and check whether
    some that previously couldn't be selected now can be.

    Signed-off-by: Jan Beulich
    Signed-off-by: Michal Marek

    Jan Beulich
     

02 Jul, 2010

1 commit

  • The "select" statement in Kconfig files allows the enabling of options
    even if they have unmet direct dependencies (i.e. "depends on" expands
    to "no"). Currently, the "depends on" clauses are used in calculating
    the visibility but they do not affect the reverse dependencies in any
    way.

    The patch introduces additional tracking of the "depends on" statements
    and prints a warning on selecting an option if its direct dependencies
    are not met.

    Signed-off-by: Catalin Marinas
    Cc: Sam Ravnborg
    Cc: Arnd Bergmann
    Cc: Andrew Morton
    Cc: Linus Torvalds
    Signed-off-by: Michal Marek

    Catalin Marinas
     

12 Jun, 2010

1 commit

  • Not sure if this is correct or not, but with
    make menuconfig
    HOSTCC scripts/kconfig/conf.o
    scripts/kconfig/conf.c: In function 'conf_sym':
    scripts/kconfig/conf.c:159:6: warning: variable 'type' set but not used
    scripts/kconfig/conf.c: In function 'conf_choice':
    scripts/kconfig/conf.c:231:6: warning: variable 'type' set but not used
    HOSTLD scripts/kconfig/mconf

    I get this using gcc 4.6.0 the below change fixes this form me.

    Signed-off-by: Justin P. Mattock
    Signed-off-by: Michal Marek

    Justin P. Mattock
     

05 Jun, 2010

1 commit


03 Jun, 2010

4 commits

  • Truncate list items to fit in a single line, otherwise those items
    which have long prompts will cover some other items.

    This follows the behavior of menubox.

    Signed-off-by: Li Zefan
    Signed-off-by: Michal Marek

    Li Zefan
     
  • Run:
    make ARCH=arm menuconfig

    And then select "System Type" -> "ARM system type". The kconfig
    "choice" menu at this point looks empty.

    It's because config ARCH_S3C2410 has a long prompt:

    config ARCH_S3C2410
    bool "Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443, S3C2450"
    ...

    menuconfig centers the checklist according to this prompt without
    considering the width of the list, and then things get wrong.

    Reported-by: Nobin Mathew
    Signed-off-by: Li Zefan
    Signed-off-by: Michal Marek

    Li Zefan
     
  • scripts/kconfig/nconf is generated by 'make nconfig',
    add it into .gitignore.

    Signed-off-by: WANG Cong
    Signed-off-by: Michal Marek

    Américo Wang
     
  • Making gconfig fails on fedora 13 as the linker cannot resolve dlsym.

    Adding libdl to the link command fixes this.

    make shows this error :-
    /usr/bin/ld: scripts/kconfig/kconfig_load.o: undefined reference to symbol 'dlsym@@GLIBC_2.2.5'
    /usr/bin/ld: note: 'dlsym@@GLIBC_2.2.5' is defined in DSO /lib64/libdl.so.2 so try adding it to the linker command line
    /lib64/libdl.so.2: could not read symbols: Invalid operation

    tested on x86_64 fedora 13.

    Signed-off-by: Richard Kennedy
    Reviewed-by: WANG Cong
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Michal Marek

    Richard Kennedy
     

02 Jun, 2010

8 commits

  • This feature has been supported in menuconfig and gconfig, so
    here add it to xconfig.

    Signed-off-by: Li Zefan
    Signed-off-by: Michal Marek

    Li Zefan
     
  • Remove ConfigInfoView::setSource().

    Signed-off-by: Li Zefan
    Signed-off-by: Michal Marek

    Li Zefan
     
  • @ok is a pointer to a bool var, so we should check the value of
    *ok. But actually we don't need to check it, so just remove the
    if statement.

    Signed-off-by: Li Zefan
    Signed-off-by: Michal Marek

    Li Zefan
     
  • In gconfig if you enable "Show all options", you'll see some "(null)"
    config options, and clicking those options triggers a warning:

    (gconf:9368): Gtk-CRITICAL **: gtk_text_buffer_insert_with_tags: assertion `text != NULL' failed

    Signed-off-by: Li Zefan
    Acked-by: Randy Dunlap
    Signed-off-by: Michal Marek

    Li Zefan
     
  • The logic should be reversed.

    Signed-off-by: Li Zefan
    Signed-off-by: Michal Marek

    Li Zefan
     
  • Suggested-by: Randy Dunlap
    Signed-off-by: Li Zefan
    Acked-by: Randy Dunlap
    Signed-off-by: Michal Marek

    Li Zefan
     
  • Those configs are not new:

    $ cat .config
    ...
    CONFIG_NAMESPACES=y
    ...
    CONFIG_BLOCK=y
    ...

    But are tagged as NEW:

    $ yes "" | make config > myconf
    $ cat myconf | grep '(NEW)'
    Namespaces support (NAMESPACES) [Y/?] (NEW) y
    ...
    Enable the block layer (BLOCK) [Y/?] (NEW) y
    ...

    You can also notice this bug when using gconfig/xconfig.

    It's because the SYMBOL_DEF_USER bit of an invisible symbol is cleared
    when the config file is read:

    int conf_read(const char *name)
    {
    ...
    for_all_symbols(i, sym) {
    if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
    /* Reset values of generates values, so they'll appear
    * as new, if they should become visible, but that
    * doesn't quite work if the Kconfig and the saved
    * configuration disagree.
    */
    if (sym->visible == no && !conf_unsaved)
    sym->flags &= ~SYMBOL_DEF_USER;
    ...
    }

    But a menu item which represents an invisible symbol is still
    visible, if it's sub-menu is visible, so its SYMBOL_DEF_USER
    bit should be set to indicate it's not NEW.

    Signed-off-by: Li Zefan
    Signed-off-by: Michal Marek

    Li Zefan
     
  • Without this patch, one has to refer to the Kconfig file to find
    out the range of an integer/hex symbol.

    │ Symbol: NR_CPUS [=4]
    │ Type : integer
    │ Range : [2 8]
    │ Prompt: Maximum number of CPUs
    │ Defined at arch/x86/Kconfig:761
    │ Depends on: SMP [=y] && !MAXSMP [=n]
    │ Location:
    │ -> Processor type and features

    Signed-off-by: Li Zefan
    Signed-off-by: Michal Marek

    Li Zefan