1. 13 4月, 2018 1 次提交
    • D
      kconfig: extend output of 'listnewconfig' · 17baab68
      Don Zickus 提交于
      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: NDon Zickus <dzickus@redhat.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      17baab68
  2. 26 3月, 2018 5 次提交
    • M
      kconfig: rename silentoldconfig to syncconfig · 911a91c3
      Masahiro Yamada 提交于
      As commit cedd55d4 ("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: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      911a91c3
    • M
      kconfig: hide irrelevant sub-menus for oldconfig · 2aad9b89
      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 cd9140e1 ("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 204c96f6 ("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 4062f1a4 ("kconfig: use long options in conf") made
          oldconfig as loud as [0] due to misconversion.
      
      [4] Commit 14828349 ("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: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      2aad9b89
    • M
      kconfig: remove redundant input_mode test for check_conf() loop · 99f0b657
      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: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      99f0b657
    • M
      kconfig: remove unneeded input_mode test in conf() · 4bb3a5b0
      Masahiro Yamada 提交于
      conf() is never called for listnewconfig / olddefconfig.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      4bb3a5b0
    • M
      kconfig: do not call check_conf() for olddefconfig · 59a80b5e
      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: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      59a80b5e
  3. 09 2月, 2018 4 次提交
    • M
      kconfig: send error messages to stderr · 9e3e10c7
      Masahiro Yamada 提交于
      These messages should be directed to stderr.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      9e3e10c7
    • M
      kconfig: echo stdin to stdout if either is redirected · f3ff6fb5
      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: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      f3ff6fb5
    • M
      kconfig: remove check_stdin() · d2a04648
      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: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      d2a04648
    • M
      kconfig: show '?' prompt even if no help text is available · 4f208f39
      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: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NUlf Magnusson <ulfalizer@gmail.com>
      4f208f39
  4. 28 1月, 2018 1 次提交
  5. 21 1月, 2018 2 次提交
  6. 10 12月, 2015 1 次提交
  7. 09 4月, 2015 1 次提交
  8. 10 6月, 2014 1 次提交
  9. 25 6月, 2013 1 次提交
    • Y
      kconfig: loop as long as we changed some symbols in randconfig · 3b9a19e0
      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<--- choice-in-choice.in
          choice
              bool "A/B/C"
          config A
              bool "A"
      
          config B
              bool "B"
          if B
          choice
              bool "E/F"
          config E
              bool "E"
          config F
              bool "F"
          endchoice
          endif # B
      
          config C
              bool "C"
          endchoice
          ---8<---
      
          $ ./scripts/kconfig/conf --randconfig choice-in-choice.in
          [--SNIP--]
          $ ./scripts/kconfig/conf --silentoldconfig choice-in-choice.in </dev/null
          [--SNIP--]
          A/B/C
            1. A (A)
          > 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: N"Yann E. MORIN" <yann.morin.1998@free.fr>
      3b9a19e0
  10. 19 6月, 2013 2 次提交
  11. 25 4月, 2013 1 次提交
    • Y
      kconfig: allow specifying the seed for randconfig · 0d8024c6
      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: N"Yann E. MORIN" <yann.morin.1998@free.fr>
      0d8024c6
  12. 19 2月, 2013 1 次提交
  13. 28 9月, 2012 1 次提交
  14. 31 8月, 2012 1 次提交
  15. 08 5月, 2012 1 次提交
    • E
      kbuild: all{no,yes,mod,def,rand}config only read files when instructed to. · 9f420bf0
      Eric W. Biederman 提交于
      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: NEric W. Biederman <ebiederm@xmission.com>
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      9f420bf0
  16. 05 5月, 2012 1 次提交
    • E
      kconfig: Add error handling to KCONFIG_ALLCONFIG · 5efe241e
      Eric W. Biederman 提交于
      - 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: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      5efe241e
  17. 02 7月, 2011 3 次提交
  18. 07 6月, 2011 2 次提交
  19. 24 4月, 2011 1 次提交
    • B
      kconfig: Avoid buffer underrun in choice input · 3ba41621
      Ben Hutchings 提交于
      Commit 40aee729 ('kconfig: fix default value for choice input')
      fixed some cases where kconfig would select the wrong option from a
      choice with a single valid option and thus enter an infinite loop.
      
      However, this broke the test for user input of the form 'N?', because
      when kconfig selects the single valid option the input is zero-length
      and the test will read the byte before the input buffer.  If this
      happens to contain '?' (as it will in a mips build on Debian unstable
      today) then kconfig again enters an infinite loop.
      Signed-off-by: NBen Hutchings <ben@decadent.org.uk>
      Cc: stable@kernel.org [2.6.17+]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3ba41621
  20. 08 4月, 2011 1 次提交
    • B
      kconfig: Avoid buffer underrun in choice input · 466de918
      Ben Hutchings 提交于
      commit 40aee729 ('kconfig: fix default
      value for choice input') fixed some cases where kconfig would select
      the wrong option from a choice with a single valid option and thus
      enter an infinite loop.
      
      However, this broke the test for user input of the form 'N?', because
      when kconfig selects the single valid option the input is zero-length
      and the test will read the byte before the input buffer.  If this
      happens to contain '?' (as it will in a mips build on Debian unstable
      today) then kconfig again enters an infinite loop.
      Signed-off-by: NBen Hutchings <ben@decadent.org.uk>
      Cc: stable@kernel.org [2.6.17+]
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      466de918
  21. 15 12月, 2010 1 次提交
  22. 10 10月, 2010 1 次提交
  23. 20 9月, 2010 2 次提交
  24. 08 9月, 2010 1 次提交
  25. 31 8月, 2010 1 次提交
  26. 13 8月, 2010 1 次提交
  27. 07 8月, 2010 1 次提交