1. 11 11月, 2019 1 次提交
    • M
      kconfig: split util.c out of parser.y · 521b29b6
      Masahiro Yamada 提交于
      util.c exists both in scripts/kconfig/ and scripts/kconfig/lxdialog.
      
      Prior to commit 54b8ae66 ("kbuild: change *FLAGS_<basetarget>.o
      to take the path relative to $(obj)"), Kbuild could not pass different
      flags to source files with the same basename. Now that this issue
      was solved, you can split util.c out of parser.y and compile them
      independently of each other.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      521b29b6
  2. 04 9月, 2019 2 次提交
    • G
      merge_config.sh: ignore unwanted grep errors · 60bef52c
      Guillaume Tucker 提交于
      The merge_config.sh script verifies that all the config options have
      their expected value in the resulting file and prints any issues as
      warnings.  These checks aren't intended to be treated as errors given
      the current implementation.  However, since "set -e" was added, if the
      grep command to look for a config option does not find it the script
      will then abort prematurely.
      
      Handle the case where the grep exit status is non-zero by setting
      ACTUAL_VAL to an empty string to restore previous functionality.
      
      Fixes: cdfca821 ("merge_config.sh: Check error codes from make")
      Signed-off-by: NGuillaume Tucker <guillaume.tucker@collabora.com>
      Acked-by: NJon Hunter <jonathanh@nvidia.com>
      Tested-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      60bef52c
    • M
      kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj) · 54b8ae66
      Masahiro Yamada 提交于
      Kbuild provides per-file compiler flag addition/removal:
      
        CFLAGS_<basetarget>.o
        CFLAGS_REMOVE_<basetarget>.o
        AFLAGS_<basetarget>.o
        AFLAGS_REMOVE_<basetarget>.o
        CPPFLAGS_<basetarget>.lds
        HOSTCFLAGS_<basetarget>.o
        HOSTCXXFLAGS_<basetarget>.o
      
      The <basetarget> is the filename of the target with its directory and
      suffix stripped.
      
      This syntax comes into a trouble when two files with the same basename
      appear in one Makefile, for example:
      
        obj-y += foo.o
        obj-y += dir/foo.o
        CFLAGS_foo.o := <some-flags>
      
      Here, the <some-flags> applies to both foo.o and dir/foo.o
      
      The real world problem is:
      
        scripts/kconfig/util.c
        scripts/kconfig/lxdialog/util.c
      
      Both files are compiled into scripts/kconfig/mconf, but only the
      latter should be given with the ncurses flags.
      
      It is more sensible to use the relative path to the Makefile, like this:
      
        obj-y += foo.o
        CFLAGS_foo.o := <some-flags>
        obj-y += dir/foo.o
        CFLAGS_dir/foo.o := <other-flags>
      
      At first, I attempted to replace $(basetarget) with $*. The $* variable
      is replaced with the stem ('%') part in a pattern rule. This works with
      most of cases, but does not for explicit rules.
      
      For example, arch/ia64/lib/Makefile reuses rule_as_o_S in its own
      explicit rules, so $* will be empty, resulting in ignoring the per-file
      AFLAGS.
      
      I introduced a new variable, target-stem, which can be used also from
      explicit rules.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Acked-by: NMarc Zyngier <maz@kernel.org>
      54b8ae66
  3. 29 8月, 2019 1 次提交
  4. 22 8月, 2019 1 次提交
  5. 04 8月, 2019 1 次提交
    • M
      kconfig: Clear "written" flag to avoid data loss · 0c5b6c28
      M. Vefa Bicakci 提交于
      Prior to this commit, starting nconfig, xconfig or gconfig, and saving
      the .config file more than once caused data loss, where a .config file
      that contained only comments would be written to disk starting from the
      second save operation.
      
      This bug manifests itself because the SYMBOL_WRITTEN flag is never
      cleared after the first call to conf_write, and subsequent calls to
      conf_write then skip all of the configuration symbols due to the
      SYMBOL_WRITTEN flag being set.
      
      This commit resolves this issue by clearing the SYMBOL_WRITTEN flag
      from all symbols before conf_write returns.
      
      Fixes: 8e2442a5 ("kconfig: fix missing choice values in auto.conf")
      Cc: linux-stable <stable@vger.kernel.org> # 4.19+
      Signed-off-by: NM. Vefa Bicakci <m.v.b@runbox.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      0c5b6c28
  6. 17 7月, 2019 2 次提交
    • M
      kconfig: fix missing choice values in auto.conf · 8e2442a5
      Masahiro Yamada 提交于
      Since commit 00c864f8 ("kconfig: allow all config targets to write
      auto.conf if missing"), Kconfig creates include/config/auto.conf in the
      defconfig stage when it is missing.
      
      Joonas Kylmälä reported incorrect auto.conf generation under some
      circumstances.
      
      To reproduce it, apply the following diff:
      
      |  --- a/arch/arm/configs/imx_v6_v7_defconfig
      |  +++ b/arch/arm/configs/imx_v6_v7_defconfig
      |  @@ -345,14 +345,7 @@ CONFIG_USB_CONFIGFS_F_MIDI=y
      |   CONFIG_USB_CONFIGFS_F_HID=y
      |   CONFIG_USB_CONFIGFS_F_UVC=y
      |   CONFIG_USB_CONFIGFS_F_PRINTER=y
      |  -CONFIG_USB_ZERO=m
      |  -CONFIG_USB_AUDIO=m
      |  -CONFIG_USB_ETH=m
      |  -CONFIG_USB_G_NCM=m
      |  -CONFIG_USB_GADGETFS=m
      |  -CONFIG_USB_FUNCTIONFS=m
      |  -CONFIG_USB_MASS_STORAGE=m
      |  -CONFIG_USB_G_SERIAL=m
      |  +CONFIG_USB_FUNCTIONFS=y
      |   CONFIG_MMC=y
      |   CONFIG_MMC_SDHCI=y
      |   CONFIG_MMC_SDHCI_PLTFM=y
      
      And then, run:
      
      $ make ARCH=arm mrproper imx_v6_v7_defconfig
      
      You will see CONFIG_USB_FUNCTIONFS=y is correctly contained in the
      .config, but not in the auto.conf.
      
      Please note drivers/usb/gadget/legacy/Kconfig is included from a choice
      block in drivers/usb/gadget/Kconfig. So USB_FUNCTIONFS is a choice value.
      
      This is probably a similar situation described in commit beaaddb6
      ("kconfig: tests: test defconfig when two choices interact").
      
      When sym_calc_choice() is called, the choice symbol forgets the
      SYMBOL_DEF_USER unless all of its choice values are explicitly set by
      the user.
      
      The choice symbol is given just one chance to recall it because
      set_all_choice_values() is called if SYMBOL_NEED_SET_CHOICE_VALUES
      is set.
      
      When sym_calc_choice() is called again, the choice symbol forgets it
      forever, since SYMBOL_NEED_SET_CHOICE_VALUES is a one-time aid.
      Hence, we cannot call sym_clear_all_valid() again and again.
      
      It is crazy to repeat set and unset of internal flags. However, we
      cannot simply get rid of "sym->flags &= flags | ~SYMBOL_DEF_USER;"
      Doing so would re-introduce the problem solved by commit 5d09598d
      ("kconfig: fix new choices being skipped upon config update").
      
      To work around the issue, conf_write_autoconf() stopped calling
      sym_clear_all_valid().
      
      conf_write() must be changed accordingly. Currently, it clears
      SYMBOL_WRITE after the symbol is written into the .config file. This
      is needed to prevent it from writing the same symbol multiple times in
      case the symbol is declared in two or more locations. I added the new
      flag SYMBOL_WRITTEN, to track the symbols that have been written.
      
      Anyway, this is a cheesy workaround in order to suppress the issue
      as far as defconfig is concerned.
      
      Handling of choices is totally broken. sym_clear_all_valid() is called
      every time a user touches a symbol from the GUI interface. To reproduce
      it, just add a new symbol drivers/usb/gadget/legacy/Kconfig, then touch
      around unrelated symbols from menuconfig. USB_FUNCTIONFS will disappear
      from the .config file.
      
      I added the Fixes tag since it is more fatal than before. But, this
      has been broken since long long time before, and still it is.
      We should take a closer look to fix this correctly somehow.
      
      Fixes: 00c864f8 ("kconfig: allow all config targets to write auto.conf if missing")
      Cc: linux-stable <stable@vger.kernel.org> # 4.19+
      Reported-by: NJoonas Kylmälä <joonas.kylmala@iki.fi>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Tested-by: NJoonas Kylmälä <joonas.kylmala@iki.fi>
      8e2442a5
    • M
      kconfig: run olddefconfig instead of oldconfig after merging fragments · 3266c806
      Masahiro Yamada 提交于
      'make olddefconfig' is non-interactive, so we can drop 'yes'.
      The behavior is equivalent.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      3266c806
  7. 11 7月, 2019 1 次提交
  8. 06 7月, 2019 1 次提交
  9. 15 6月, 2019 1 次提交
    • M
      docs: kbuild: convert docs to ReST and rename to *.rst · cd238eff
      Mauro Carvalho Chehab 提交于
      The kbuild documentation clearly shows that the documents
      there are written at different times: some use markdown,
      some use their own peculiar logic to split sections.
      
      Convert everything to ReST without affecting too much
      the author's style and avoiding adding uneeded markups.
      
      The conversion is actually:
        - add blank lines and identation in order to identify paragraphs;
        - fix tables markups;
        - add some lists markups;
        - mark literal blocks;
        - adjust title markups.
      
      At its new index.rst, let's add a :orphan: while this is not linked to
      the main index.rst file, in order to avoid build warnings.
      Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Signed-off-by: NJonathan Corbet <corbet@lwn.net>
      cd238eff
  10. 09 6月, 2019 4 次提交
  11. 05 6月, 2019 1 次提交
    • M
      kconfig: tests: fix recursive inclusion unit test · 8dde5715
      Masahiro Yamada 提交于
      Adding SPDX license identifier is pretty safe; however, here is one
      exception.
      
      Since commit ec8f24b7 ("treewide: Add SPDX license identifier -
      Makefile/Kconfig"), "make testconfig" would not pass.
      
      When Kconfig detects a circular file inclusion, it displays error
      messages with a file name and a line number prefixed to each line.
      
      The unit test checks if Kconfig emits the error messages correctly
      (this also checks the line number correctness).
      
      Now that the test input has the SPDX license identifier at the very top,
      the line numbers in the expected stderr should be incremented by 1.
      
      Fixes: ec8f24b7 ("treewide: Add SPDX license identifier - Makefile/Kconfig")
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      8dde5715
  12. 21 5月, 2019 1 次提交
  13. 19 5月, 2019 1 次提交
  14. 18 5月, 2019 2 次提交
  15. 14 5月, 2019 3 次提交
  16. 11 5月, 2019 3 次提交
    • M
      kconfig: make parent directories for the saved .config as needed · 580c5b3e
      Masahiro Yamada 提交于
      With menuconfig / nconfig, users can input any file path from the
      "Save" menu, but it fails if the parent directory does not exist.
      
      Why not create the parent directory automatically. I think this is
      a user-friendly behavior.
      
      I changed the error messages in menuconfig / nconfig.
      
      "Nonexistent directory" is no longer the most likely reason of the
      failure. Perhaps, the user specified the existing directory, or
      attempted to write to the location without write permission.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      580c5b3e
    • M
      kconfig: do not write .config if the content is the same · 67424f61
      Masahiro Yamada 提交于
      Kconfig updates the .config when it exits even if its content is
      exactly the same as before. Since its timestamp becomes newer than
      that of other build artifacts, additional processing is invoked,
      which is annoying.
      
      - syncconfig is invoked to update include/config/auto.conf, etc.
      
      - kernel/configs.o is recompiled if CONFIG_IKCONFIG is enabled,
        then vmlinux is relinked as well.
      
      If the .config is not changed at all, we do not have to even
      touch it. Just bail out showing "No change to .config".
      
        $ make allmodconfig
        scripts/kconfig/conf  --allmodconfig Kconfig
        #
        # configuration written to .config
        #
        $ make allmodconfig
        scripts/kconfig/conf  --allmodconfig Kconfig
        #
        # No change to .config
        #
      Reported-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      67424f61
    • M
      kconfig: do not accept a directory for configuration output · ceb7f329
      Masahiro Yamada 提交于
      Currently, conf_write() can be called with a directory name instead
      of a file name. As far as I see, this can happen for menuconfig,
      nconfig, gconfig.
      
      If it is given with a directory path, conf_write() kindly appends
      getenv("KCONFIG_CONFIG"), but this ends up with hacky dir/basename
      handling, and screwed up in corner-cases like "what if KCONFIG_CONFIG
      is an absolute path?" as discussed before:
      
        https://patchwork.kernel.org/patch/9910037/
      
      Since conf_write() is already messed up, I'd say "do not do it".
      Please pass a file path all the time. If a directory path is specified
      for the configuration output, conf_write() will simply error out.
      
      Now that the tmp file is created in the same directory as the .config,
      the previously reported "what if KCONFIG_CONFIG points to a different
      file system?" has been solved.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Nicolas Porcel <nicolasporcel06@gmail.com>
      ceb7f329
  17. 09 5月, 2019 1 次提交
  18. 09 4月, 2019 1 次提交
  19. 29 3月, 2019 1 次提交
  20. 17 3月, 2019 1 次提交
  21. 12 3月, 2019 1 次提交
  22. 27 2月, 2019 1 次提交
  23. 13 2月, 2019 2 次提交
  24. 14 1月, 2019 1 次提交
  25. 06 1月, 2019 3 次提交
  26. 28 12月, 2018 2 次提交