07 Jan, 2020

1 commit

  • Since kernel configs provided by syzbot are close to "make allyesconfig",
    it takes long time to rebuild. This is especially waste of time when we
    need to rebuild for many times (e.g. doing manual printk() inspection,
    bisect operations).

    We can save time if we can exclude modules which are irrelevant to each
    problem. But "make localmodconfig" cannot exclude modules which are built
    into vmlinux because /sbin/lsmod output is used as the source of modules.

    Therefore, this patch adds "make yes2modconfig" which converts from =y
    to =m if possible. After confirming that the interested problem is still
    reproducible, we can try "make localmodconfig" (and/or manually tune
    based on "Modules linked in:" line) in order to exclude modules which are
    irrelevant to the interested problem. While we are at it, this patch also
    adds "make mod2yesconfig" which converts from =m to =y in case someone
    wants to convert from =m to =y after "make localmodconfig".

    Signed-off-by: Tetsuo Handa
    Cc: Dmitry Vyukov
    Signed-off-by: Masahiro Yamada

    Tetsuo Handa
     

11 Nov, 2019

1 commit

  • make listnewconfig will list the individual options that need to be set.
    This is useful but there's no easy way to get the help text associated
    with the options at the same time. Introduce a new targe
    'make helpnewconfig' which lists the full help text of all the
    new options as well. This makes it easier to automatically generate
    changes that are easy for humans to review. This command also adds
    markers between each option for easier parsing.

    Signed-off-by: Laura Abbott
    Acked-by: Randy Dunlap
    Signed-off-by: Masahiro Yamada

    Laura Abbott
     

06 Jul, 2019

1 commit


09 Jun, 2019

1 commit

  • Currently, the argument for --defconfig is optional. If the argument
    is not passed, the hard-coded default arch/$(ARCH)/defconfig is used.

    It no longer happens in Linux since the last users of the default are
    gone by the following commits:

    - Commit f3e20ad67b4c ("s390: move arch/s390/defconfig to
    arch/s390/configs/defconfig")

    - Commit 986a13769c4b ("alpha: move arch/alpha/defconfig to
    arch/alpha/configs/defconfig")

    I want to kill the Linux-specific directory path embedded in the
    Kconfig binary.

    The --savedefconfig (reverse operation of --defconfig) requires an
    argument, so it should not hurt to do likewise for --defconfig.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

27 Feb, 2019

1 commit


28 Dec, 2018

1 commit

  • All files in lxdialog/ are licensed under GPL-2.0+, and the rest are
    under GPL-2.0. I added GPL-2.0 tags to test scripts in tests/.

    Documentation/process/license-rules.rst does not suggest anything
    about the flex/bison files. Because flex does not accept the C++
    comment style at the very top of a file, I used the C style for
    zconf.l, and so for zconf.y for consistency.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

01 Nov, 2018

1 commit


22 Aug, 2018

1 commit


25 Jul, 2018

2 commits

  • Currently, only syncconfig creates or updates include/config/auto.conf
    and some other files. Other config targets create or update only the
    .config file.

    When you configure and build the kernel from a pristine source tree,
    any config target is followed by syncconfig in the build stage since
    include/config/auto.conf is missing.

    We are moving compiler tests from Makefile to Kconfig. It means that
    parsing Kconfig files will be more costly since Kconfig invokes the
    compiler commands internally. Thus, we want to avoid invoking Kconfig
    twice (one for *config to create the .config, and one for syncconfig
    to synchronize the auto.conf). If auto.conf does not exist, we can
    generate all configuration files in the first configuration stage,
    which will save the syncconfig in the build stage.

    Please note this should be done only when auto.conf is missing. If
    *config blindly did this, time stamp files under include/config/ would
    be unnecessarily touched, triggering unneeded rebuild of objects.

    I assume a scenario like this:

    1. You have a source tree that has already been built
    with CONFIG_FOO disabled

    2. Run "make menuconfig" to enable CONFIG_FOO

    3. CONFIG_FOO turns out to be unnecessary.
    Run "make menuconfig" again to disable CONFIG_FOO

    4. Run "make"

    In this case, include/config/foo.h should not be touched since there
    is no change in CONFIG_FOO. The sync process should be delayed until
    the user really attempts to build the kernel.

    This commit has another motivation; I want to suppress the 'No such
    file or directory' warning from the 'include' directive.

    The top-level Makefile includes auto.conf with '-include' directive,
    like this:

    ifeq ($(dot-config),1)
    -include include/config/auto.conf
    endif

    This looks strange because auto.conf is mandatory when dot-config is 1.
    I guess only the reason of using '-include' is to suppress the warning
    'include/config/auto.conf: No such file or directory' when building
    from a clean tree. However, this has a side-effect; Make considers
    the files included by '-include' are optional. Hence, Make continues
    to build even if it fails to generate include/config/auto.conf. I will
    change this in the next commit, but the warning message is annoying.
    (At least, kbuild test robot reports it as a regression.)

    With this commit, Kconfig will generate all configuration files together
    with the .config and I guess it is a solution good enough to suppress
    the warning.

    Note:
    GNU Make 4.2 or later does not display the warning from the 'include'
    directive if include files are successfully generated. See GNU Make
    commit 87a5f98d248f ("[SV 102] Don't show unnecessary include file
    errors.") However, older GNU Make versions are still widely used.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     
  • syncconfig updates the .config only when sym_change_count > 0, i.e.
    any change in config symbols has been detected.

    Not only symbols but also comments are contained in the .config file.
    If only comments are updated, they are not fed back to the .config,
    then the stale comments are left-over. Of course, this is just a
    matter of comments, but why not fix it.

    I see some scenarios where this happens.

    Scenario A:

    1. You have a source tree that has already been configured.

    2. Linus increments the version number in the top-level Makefile
    (i.e. he commits a new release)

    3. You pull it, and run 'make'

    4. syncconfig is invoked because the environment variable,
    KERNELVERSION is updated, but the .config is not updated since
    no config symbol is changed.

    5. The .config file contains a kernel version in the top line:

    # Automatically generated file; DO NOT EDIT.
    # Linux/arm64 4.18.0-rc2 Kernel Configuration

    ... which points to a previous version.

    Scenario B:

    1. You have a source tree that has already been configured.

    2. You upgrade the compiler, but it still has the same version number.
    This may happen if you regularly build the latest compiler from
    the source code.

    3. You run 'make'

    4. syncconfig is invoked because the environment variable,
    CC_VERSION_TEXT is updated, but the .config is not updated since
    no config symbol is changed.

    5. The .config file contains the version string of the compiler:

    #
    # Compiler: aarch64-linux-gcc (GCC) 9.0.0 20180628 (experimental)
    #

    ... which carries the information of the old compiler.

    If KCONFIG_NOSILENTUPDATE is set, syncconfig is not allowed to update
    the .config file. Otherwise, it is fine to update it regardless of
    sym_change_count.

    Signed-off-by: Masahiro Yamada

    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
     

13 Apr, 2018

1 commit

  • We at Red Hat/Fedora have generally tried to have a per file breakdown of
    every config option we set. This makes it easy for us to add new options
    when they are exposed and keep a changelog of why they were set.

    A Fedora example is here:
    https://src.fedoraproject.org/cgit/rpms/kernel.git/tree/configs/fedora/generic

    Using various merge scripts, we build up a config file and run it through
    'make listnewconfig' and 'make oldnoconfig'. The idea is to print out new
    config options that haven't been manually set and use the default until
    a patch is posted to set it properly.

    To speed things up, it would be nice to make it easier to generate a
    patch to post the default setting. The output of 'make listnewconfig'
    has two issues that limit us:

    - it doesn't provide the default value
    - it doesn't provide the new 'choice' options that get flagged in
    'oldconfig'

    This patch extends 'listnewconfig' to address the above two issues.

    This allows us to run a script

    make listnewconfig | rhconfig-tool -o patches; git send-email patches/

    The output of 'make listnewconfig':

    CONFIG_NET_EMATCH_IPT
    CONFIG_IPVLAN
    CONFIG_ICE
    CONFIG_NET_VENDOR_NI
    CONFIG_IEEE802154_MCR20A
    CONFIG_IR_IMON_DECODER
    CONFIG_IR_IMON_RAW

    The new output of 'make listnewconfig':

    CONFIG_KERNEL_XZ=n
    CONFIG_KERNEL_LZO=n
    CONFIG_NET_EMATCH_IPT=n
    CONFIG_IPVLAN=n
    CONFIG_ICE=n
    CONFIG_NET_VENDOR_NI=y
    CONFIG_IEEE802154_MCR20A=n
    CONFIG_IR_IMON_DECODER=n
    CONFIG_IR_IMON_RAW=n

    Signed-off-by: Don Zickus
    Signed-off-by: Masahiro Yamada

    Don Zickus
     

26 Mar, 2018

5 commits

  • As commit cedd55d49dee ("kconfig: Remove silentoldconfig from help
    and docs; fix kconfig/conf's help") mentioned, 'silentoldconfig' is a
    historical misnomer. That commit removed it from help and docs since
    it is an internal interface. If so, it should be allowed to rename
    it to something more intuitive. 'syncconfig' is the one I came up
    with because it updates the .config if necessary, then synchronize
    include/generated/autoconf.h and include/config/* with it.

    You should not manually invoke 'silentoldcofig'. Display warning if
    used in case existing scripts are doing wrong.

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

    Masahiro Yamada
     
  • Historically, "make oldconfig" has changed its behavior several times,
    quieter or louder. (I attached the history below.) Currently, it is
    not as quiet as it should be. This commit addresses it.

    Test Case
    ---------

    ---------------------------(Kconfig)----------------------------
    menu "menu"

    config FOO
    bool "foo"

    menu "sub menu"

    config BAR
    bool "bar"

    endmenu

    endmenu

    menu "sibling menu"

    config BAZ
    bool "baz"

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

    ---------------------------(.config)----------------------------
    CONFIG_BAR=y
    CONFIG_BAZ=y
    ----------------------------------------------------------------

    With the Kconfig and .config above, "make silentoldconfig" and
    "make oldconfig" work differently, like follows:

    $ make silentoldconfig
    scripts/kconfig/conf --silentoldconfig Kconfig
    *
    * Restart config...
    *
    *
    * menu
    *
    foo (FOO) [N/y/?] (NEW) y
    #
    # configuration written to .config
    #

    $ make oldconfig
    scripts/kconfig/conf --oldconfig Kconfig
    *
    * Restart config...
    *
    *
    * menu
    *
    foo (FOO) [N/y/?] (NEW) y
    *
    * sub menu
    *
    bar (BAR) [Y/n/?] y
    #
    # configuration written to .config
    #

    Both hide "sibling node" since it is irrelevant. The difference is
    that silentoldconfig hides "sub menu" whereas oldconfig does not.
    The behavior of silentoldconfig is preferred since the "sub menu"
    does not contain any new symbol.

    The root cause is in conf(). There are three input modes that can
    call conf(); oldaskconfig, oldconfig, and silentoldconfig.

    Everytime conf() encounters a menu entry, it calls check_conf() to
    check if it contains new symbols. If no new symbol is found, the
    menu is just skipped.

    Currently, this happens only when input_mode == silentoldconfig.
    The oldaskconfig enters into the check_conf() loop as silentoldconfig,
    so oldaskconfig works likewise for the second loop or later, but it
    never happens for oldconfig. So, irrelevant sub-menus are shown for
    oldconfig.

    Change the test condition to "input_mode != oldaskconfig". This is
    false only for the first loop of oldaskconfig; it must ask the user
    all symbols, so no need to call check_conf().

    History of oldconfig
    --------------------

    [0] Originally, "make oldconfig" was as loud as "make config" (It
    showed the entire .config file)

    [1] Commit cd9140e1e73a ("kconfig: make oldconfig is now less chatty")
    made oldconfig quieter, but it was still less quieter than
    silentoldconfig. (oldconfig did not hide sub-menus)

    [2] Commit 204c96f60904 ("kconfig: fix silentoldconfig") changed
    the input_mode of oldconfig to "ask_silent" from "ask_new".
    So, oldconfig really became as quiet as silentoldconfig.
    (oldconfig hided irrelevant sub-menus)

    [3] Commit 4062f1a4c030 ("kconfig: use long options in conf") made
    oldconfig as loud as [0] due to misconversion.

    [4] Commit 14828349719a ("kconfig: fix make oldconfig") addressed
    the misconversion of [3], but it made oldconfig quieter only to
    the same level as [1], not [2].

    This commit is restoring the behavior of [2].

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

    Masahiro Yamada
     
  • check_conf() never increments conf_cnt for listnewconfig, so conf_cnt
    is always zero.

    In other words, conf_cnt is not zero, "input_mode != listnewconfig"
    is met.

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

    Masahiro Yamada
     
  • conf() is never called for listnewconfig / olddefconfig.

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

    Masahiro Yamada
     
  • check_conf() traverses the menu tree, but it is completely no-op for
    olddefconfig because the following if-else block does nothing.

    if (input_mode == listnewconfig) {
    ...
    } else if (input_mode != olddefconfig) {
    ...
    }

    As the help message says, olddefconfig automatically sets new symbols
    to their default value. There is no room for manual intervention.
    So, calling check_conf() for olddefconfig is odd in the first place.

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

    Masahiro Yamada
     

09 Feb, 2018

4 commits

  • These messages should be directed to stderr.

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

    Masahiro Yamada
     
  • If stdio is not tty, conf_askvalue() puts additional new line to
    prevent prompts from being concatenated into a single line. This
    care is missing in conf_choice(), so a 'choice' prompt and the next
    prompt are shown in the same line.

    Move the code into xfgets() to cater to all cases. To improve this
    more, let's echo stdin to stdout. This clarifies what keys were
    input from stdio and the stdout looks like as if it were from tty.

    I removed the isatty(2) check since stderr is unrelated here.

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

    Masahiro Yamada
     
  • Except silentoldconfig, valid_stdin is 1, so check_stdin() is no-op.

    oldconfig and silentoldconfig work almost in the same way except that
    the latter generates additional files under include/. Both ask users
    for input for new symbols.

    I do not know why only silentoldconfig requires stdio be tty.

    $ rm -f .config; touch .config
    $ yes "" | make oldconfig > stdout
    $ rm -f .config; touch .config
    $ yes "" | make silentoldconfig > stdout
    make[1]: *** [silentoldconfig] Error 1
    make: *** [silentoldconfig] Error 2
    $ tail -n 4 stdout
    Console input/output is redirected. Run 'make oldconfig' to update configuration.

    scripts/kconfig/Makefile:40: recipe for target 'silentoldconfig' failed
    Makefile:507: recipe for target 'silentoldconfig' failed

    Redirection is useful, for example, for testing where we want to give
    particular key inputs from a test file, then check the result.

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

    Masahiro Yamada
     
  • 'make config', 'make oldconfig', etc. always receive '?' as a valid
    input and show useful information even if no help text is available.

    ------------------------>8------------------------
    foo (FOO) [N/y] (NEW) ?

    There is no help available for this option.
    Symbol: FOO [=n]
    Type : bool
    Prompt: foo
    Defined at Kconfig:1
    ------------------------>8------------------------

    However, '?' is not shown in the prompt if its help text is missing.
    Let's show '?' all the time so that the prompt and the behavior match.

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

    Masahiro Yamada
     

28 Jan, 2018

1 commit

  • As explained by Michal Marek at https://lkml.org/lkml/2011/8/31/189
    silentoldconfig has become a misnomer. It has become an internal interface
    so remove it from "make help" and Documentation/ to stop confusing people
    using it as seen for instance at
    https://chromium-review.googlesource.com/835632 Don't remove it from
    kconfig/Makefile yet not to break any (other) tool using it.

    On the other hand, correct and expand its description in the help of
    the (internal) scripts/kconfig/conf.c

    Signed-off-by: Marc Herbert
    Signed-off-by: Masahiro Yamada

    Marc Herbert
     

21 Jan, 2018

2 commits


10 Dec, 2015

1 commit


09 Apr, 2015

1 commit


10 Jun, 2014

1 commit


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
     

19 Jun, 2013

2 commits


25 Apr, 2013

1 commit

  • 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
     

19 Feb, 2013

1 commit

  • According to Documentation/kbuild/kconfig.txt, the commands:

    yes "" | make oldconfig >conf.new
    grep "(NEW)" conf.new

    should list the new config symbols with their default values.
    However, currently there is no line break after each new symbol. When
    kconfig is interactive the user will type a new-line at this point,
    but when non-interactive kconfig must print it.

    Signed-off-by: Ben Hutchings
    Reference: http://bugs.debian.org/636029
    [regid23@nt1.in: Adjusted Ben's work to apply cleanly to this tree]
    Reported-and-tested-by: Regid Ichira
    Reviewed-by: Jonathan Nieder
    Signed-off-by: Michal Marek

    Ben Hutchings
     

28 Sep, 2012

1 commit

  • As 67d34a6a391369269a2e5dba8a5f42cc4cd50231 said, 'oldnoconfig' doesn't
    set new symbols to 'n', but instead sets it to their default values.

    So, this patch replaces 'oldnoconfig' with 'olddefconfig', stop making
    people confused, and keep the old name 'oldnoconfig' as an alias,
    because people already are dependent on its behavior with the
    counter-intuitive name.

    Signed-off-by: Adam Lee
    Signed-off-by: Michal Marek

    Adam Lee
     

31 Aug, 2012

1 commit

  • As 67d34a6a391369269a2e5dba8a5f42cc4cd50231 said, the make target
    'oldnoconfig' is a misnomer. It doesn't set new symbols to 'n', but
    instead sets it to their default values.

    This patch fixes the document in conf.c, and will submit another patch
    to replace 'oldnoconfig' to 'olddefconfig'

    Signed-off-by: Adam Lee
    Signed-off-by: Michal Marek

    Adam Lee
     

08 May, 2012

1 commit

  • Prevent subtle surprises to both people working on the kconfig code
    and people using make allnoconfig allyesconfig allmoconfig and
    randconfig by only attempting to read a config file if
    KCONFIG_ALLCONFIG is set.

    Common sense suggests attempting to read the extra config files does
    not make sense unless requested. The documentation says the code
    won't attempt to read the extra config files unless requested.
    Current usage does not appear to include people depending on the code
    reading the config files without the variable being set So do the
    simple thing and stop reading config files when passed
    all{no,yes,mod,def,rand}config unless KCONFIG_ALLCONFIG environment
    variable is set.

    Signed-off-by: Eric W. Biederman
    Reported-by: Stephen Rothwell
    Signed-off-by: Michal Marek

    Eric W. Biederman
     

05 May, 2012

1 commit

  • - Only try to read the file specified if KCONFIG_ALL_CONFIG is set to
    something other than the empty string or "1".

    - Don't use stat to check the name passed to conf_read_simple so that
    zconf_fopen can find the file in the current directory or in SRCTREE
    removing a extremely source of confusing failure, where KCONFIG_ALL_CONFIG
    was not interpreted with respect to the directory make was called in.

    - If conf_read_simple fails complain clearly and stop processing.
    Allowing the simple debugging of typos.

    - Clearly document the behavior so it is clear to users which
    values are treated as flags and which values are treated as
    filenames.

    Signed-off-by: Eric W. Biederman
    Signed-off-by: Michal Marek

    Eric W. Biederman
     

02 Jul, 2011

3 commits


07 Jun, 2011

1 commit