14 Sep, 2015

1 commit

  • commit c0ddc8c745b7f89c50385fd7aa03c78dc543fa7a upstream.

    In kbuild it is allowed to define objects in files named "Makefile"
    and "Kbuild".
    Currently localmodconfig reads objects only from "Makefile"s and misses
    modules like nouveau.

    Link: http://lkml.kernel.org/r/1437948415-16290-1-git-send-email-richard@nod.at

    Reported-and-tested-by: Leonidas Spyropoulos
    Signed-off-by: Richard Weinberger
    Signed-off-by: Steven Rostedt
    Signed-off-by: Greg Kroah-Hartman

    Richard Weinberger
     

09 Apr, 2015

1 commit


08 Apr, 2015

1 commit


24 Mar, 2015

6 commits

  • "scripts/kconfig/merge_config.sh && make oldconfig" works well
    enough for merging local config fragments, but Kbuild currently has
    the entry points only for "kvmconfig" and "tinyconfig".

    This commit provides the generic target for mergeconfig, so we can
    manage our own config fragments easily:
    put "foo.config" in arch/$(SRCARCH)/configs/ or kernel/configs/,
    and then run "make foo.config".

    Now "make kvmconfig" is just a shorthand of "make kvm_guest.config".
    Likewise, "make tinyconfig" is equivalent to
    "make allnoconfig tiny.config".

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Josh Triplett
    Reviewed-by: Darren Hart
    Signed-off-by: Michal Marek

    Masahiro Yamada
     
  • The variable "MAKE" is used to store the command name that has
    invoked the Makefile. (Actually, it is already set to "make"
    if you run this script from a Makefile.)

    In this script, however, it is used to determine if Make should be
    run or not. It is not what we usually expect.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Josh Triplett
    Reviewed-by: Darren Hart
    Signed-off-by: Michal Marek

    Masahiro Yamada
     
  • It is true that we do not want to move the code too far to the
    right, but something like below is not preferred:

    if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then
    echo Value of $CFG is redefined by fragment $MERGE_FILE:
    echo Previous value: $PREV_VAL
    echo New value: $NEW_VAL
    echo
    elif [ "$WARNREDUN" = "true" ]; then
    echo Value of $CFG is redundant by fragment $MERGE_FILE:
    fi

    To fix this, call "continue" if the "grep" command fails to find the
    given CONFIG.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Josh Triplett
    Reviewed-by: Darren Hart
    Signed-off-by: Michal Marek

    Masahiro Yamada
     
  • Kbuild always runs in $(objtree). Actually, $(objtree) is always
    set to "." by the top-level Makefile.

    We can omit "-O $(objtree)" and "$(objtree)/".

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Josh Triplett
    Reviewed-by: Darren Hart
    Signed-off-by: Michal Marek

    Masahiro Yamada
     
  • Currently, "make tinyconfig" does not work with "-j" option.

    $ make mrproper
    $ make -j8 tinyconfig
    HOSTCC scripts/basic/fixdep
    HOSTCC scripts/kconfig/conf.o
    SHIPPED scripts/kconfig/zconf.tab.c
    SHIPPED scripts/kconfig/zconf.lex.c
    SHIPPED scripts/kconfig/zconf.hash.c
    HOSTCC scripts/kconfig/zconf.tab.o
    HOSTLD scripts/kconfig/conf
    scripts/kconfig/conf --allnoconfig Kconfig
    #
    # configuration written to .config
    #
    scripts/kconfig/Makefile:122: *** You need an existing .config
    for this target. Stop.
    make: *** [tinyconfig] Error 2

    As shown above, "allnoconfig" has created the .config file before
    mergeconfig is called, but Make still raises a false alarm because
    of some sort of race condition.

    We can fix this issue by moving the error check to the shell script.

    Anyway, scripts/kconfig/merge_config.sh always requires an existing
    .config as a base file. It is reasonable to check its existence in
    the shell script.

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Josh Triplett
    Reviewed-by: Darren Hart
    Signed-off-by: Michal Marek

    Masahiro Yamada
     
  • If "make kvmconfig" is run with "-j" option, a warning message,
    "jobserver unavailable: using -j1. Add `+' to parent make rule.",
    is displayed.

    $ make -s defconfig
    *** Default configuration is based on 'x86_64_defconfig'
    #
    # configuration written to .config
    #
    $ make -j8 kvmconfig
    Using ./.config as base
    Merging ./arch/x86/configs/kvm_guest.config
    [ snip ]
    #
    # merged configuration written to ./.config (needs make)
    #
    make[2]: warning: jobserver unavailable: using -j1. Add `+' to
    parent make rule.
    scripts/kconfig/conf --oldconfig Kconfig
    [ snip ]
    #
    # configuration written to .config
    #

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Josh Triplett
    Reviewed-by: Darren Hart
    Signed-off-by: Michal Marek

    Masahiro Yamada
     

25 Feb, 2015

4 commits


27 Jan, 2015

1 commit


08 Jan, 2015

1 commit


21 Dec, 2014

1 commit

  • Pull kbuild updates from Michal Marek:
    "Here are the kbuild changes for v3.19-rc1:

    - Cleanups and deduplication in the main Makefile and
    scripts/Makefile.*
    - Sort the output of *config targets in make help
    - Old is always removed to avoid a surprise during
    bisecting
    - Warning fix in kconfig"

    * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    kbuild: remove redundant -rR flag of hdr-inst
    kbuild: Fix make help- on powerpc
    kbuild: Automatically remove stale file
    kconfig: Fix warning "‘jump’ may be used uninitialized"
    Makefile: sort list of defconfig targets in make help output
    kbuild: Remove duplicate $(cmd) definition in Makefile.clean
    kbuild: collect shorthands into scripts/Kbuild.include

    Linus Torvalds
     

20 Dec, 2014

1 commit

  • Pull perf fixes and cleanups from Ingo Molnar:
    "A kernel fix plus mostly tooling fixes, but also some tooling
    restructuring and cleanups"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (39 commits)
    perf: Fix building warning on ARM 32
    perf symbols: Fix use after free in filename__read_build_id
    perf evlist: Use roundup_pow_of_two
    tools: Adopt roundup_pow_of_two
    perf tools: Make the mmap length autotuning more robust
    tools: Adopt rounddown_pow_of_two and deps
    tools: Adopt fls_long and deps
    tools: Move bitops.h from tools/perf/util to tools/
    tools: Introduce asm-generic/bitops.h
    tools lib: Move asm-generic/bitops/find.h code to tools/include and tools/lib
    tools: Whitespace prep patches for moving bitops.h
    tools: Move code originally from asm-generic/atomic.h into tools/include/asm-generic/
    tools: Move code originally from linux/log2.h to tools/include/linux/
    tools: Move __ffs implementation to tools/include/asm-generic/bitops/__ffs.h
    perf evlist: Do not use hard coded value for a mmap_pages default
    perf trace: Let the perf_evlist__mmap autosize the number of pages to use
    perf evlist: Improve the strerror_mmap method
    perf evlist: Clarify sterror_mmap variable names
    perf evlist: Fixup brown paper bag on "hint" for --mmap-pages cmdline arg
    perf trace: Provide a better explanation when mmap fails
    ...

    Linus Torvalds
     

09 Dec, 2014

1 commit

  • The calloc() and xcalloc() functions takes @nmemb first and then @size. Fix all w/
    pattern "calloc\s*(\s*sizeof".

    Signed-off-by: Arjun Sreedharan
    Cc: "Yann E. MORIN"
    Cc: Ingo Molnar
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Link: http://lkml.kernel.org/r/1417866043-1877-1-git-send-email-arjun024@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Arjun Sreedharan
     

28 Nov, 2014

1 commit

  • Warning:
    In file included from scripts/kconfig/zconf.tab.c:2537:0:
    scripts/kconfig/menu.c: In function ‘get_symbol_str’:
    scripts/kconfig/menu.c:590:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    jump->offset = strlen(r->s);

    Simplifies the test logic because (head && local) means (jump != 0)
    and makes GCC happy when checking if the jump pointer was initialized.

    Signed-off-by: Peter Kümmel
    Signed-off-by: Michal Marek

    Peter Kümmel
     

20 Nov, 2014

1 commit


14 Oct, 2014

1 commit

  • Pull kbuild changes from Michal Marek:
    - fix for handling dependencies of *-objs targets by Masahiro Yamada
    - lots of cleanups in the kbuild machinery, also by Masahiro
    - fixes for the kconfig build to use an UTF-8 capable ncurses library
    if possible and to build on not-so-standard installs
    - some more minor fixes

    * 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    kbuild: Do not reference *-n variables in the Makefile
    kbuild: simplify build, clean, modbuiltin shorthands
    kbuild: arm: Do not define "comma" twice
    kbuild: remove obj-n and lib-n handling
    kbuild: remove unnecessary variable initializaions
    kbuild: remove unnecessary "obj- := dummy.o" trick
    kbuild: handle C=... and M=... after entering into build directory
    kbuild: use $(Q) for sub-make target
    kbuild: fake the "Entering directory ..." message more simply
    kconfig/lxdialog: get ncurses CFLAGS with pkg-config
    kconfig: nconfig: fix multi-byte UTF handling
    kconfig: lxdialog: fix spelling
    kbuild: Make scripts executable
    kbuild: remove redundant clean-files from scripts/kconfig/Makefile
    kbuild: refactor script/kconfig/Makefile
    kbuild: handle the dependency of multi-objs hostprogs appropriately
    kbuild: handle multi-objs dependency appropriately

    Linus Torvalds
     

23 Sep, 2014

1 commit

  • This makes "make menuconfig" also work on systems where ncurses is not
    installed in a standard location (such as on NixOS).

    This patch changes ccflags() so that it tries pkg-config first, and only
    if pkg-config fails does it go back to the fallback/manual checks. This
    is the same algorithm that ldflags() already uses.

    Signed-off-by: Bjørn Forsman
    Signed-off-by: Michal Marek

    Bjørn Forsman
     

22 Aug, 2014

2 commits

  • Currently, Kconfig descriptions that use multi-byte UTF-8 characters
    (such as MTD_NAND_CAFE) will have their menu entries dropped from the
    'make nconfig' ncurses menu, and all subsequent entries in the same
    window will be omitted. This seems to be due to the ncurses 'menu'
    library, which does not traditionally handle UTF-8 >8-bit characters
    properly.

    The ncursesw library ('w' is for "wide") is written to handle these
    UTF-8 characters, and is practically a drop-in replacement at the source
    level. Use it by default, if available.

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=43067
    Signed-off-by: Brian Norris
    Cc: "Yann E. MORIN"
    Cc: Martin Walch
    Acked-by: Sam Ravnborg
    Signed-off-by: Michal Marek

    Brian Norris
     
  • Signed-off-by: Brian Norris
    Cc: "Yann E. MORIN"
    Signed-off-by: Michal Marek

    Brian Norris
     

20 Aug, 2014

1 commit


19 Aug, 2014

2 commits


09 Aug, 2014

2 commits

  • Since commit 5d2acfc7b974bbd3858b4dd3f2cdc6362dd8843a ("kconfig: make
    allnoconfig disable options behind EMBEDDED and EXPERT") in 3.15-rc1,
    "make allnoconfig" disables every possible config option.

    However, a few configuration options (CC_OPTIMIZE_FOR_SIZE,
    OPTIMIZE_INLINING) produce a smaller kernel when turned on, and a few
    choices exist (compression, highmem, allocator) for which a non-default
    option produces a smaller kernel.

    Add a "tinyconfig" option, which starts from allnoconfig and then sets
    these options to configure the tiniest possible kernel. This provides a
    better baseline for embedded systems or efforts to reduce kernel size.

    Signed-off-by: Josh Triplett

    Josh Triplett
     
  • The new mergeconfig helper makes it easier to add other partial
    configurations similar to kvmconfig. Architecture-independent portions
    of those partial configurations should go in
    kernel/configs/${name}.config, and architecture-dependent portions
    should go in arch/${arch}/configs/${name}.config.

    Based on a patch by Luis R. Rodriguez .
    Originally-Signed-off-by: Luis R. Rodriguez

    Modified to make the helper name more general than just virtualization,
    support architecture-dependent and architecture-independent partial
    configurations, move the helper and kvmconfig to
    scripts/kconfig/Makefile, and factor out more of the common file path.

    Signed-off-by: Josh Triplett

    Josh Triplett
     

13 Jun, 2014

1 commit

  • Pull kbuild misc updates from Michal Marek:
    "This is the non-critical part of kbuild for v3.16-rc1:
    - make deb-pkg can do s390x and arm64
    - new patterns in scripts/tags.sh
    - scripts/tags.sh skips userspace tools' sources (which sometimes
    have copies of kernel structures) and symlinks
    - improvements to the objdiff tool
    - two new coccinelle patches
    - other minor fixes"

    * 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
    scripts: objdiff: support directories for the augument of record command
    scripts: objdiff: fix a comment
    scripts: objdiff: change the extension of disassembly from .o to .dis
    scripts: objdiff: improve path flexibility for record command
    scripts: objdiff: remove unnecessary code
    scripts: objdiff: direct error messages to stderr
    scripts: objdiff: get the path to .tmp_objdiff more simply
    deb-pkg: Add automatic support for s390x architecture
    coccicheck: Add unneeded return variable test
    kbuild: Fix a typo in documentation
    kbuild: trivial - use tabs for code indent where possible
    kbuild: trivial - remove trailing empty lines
    coccinelle: Check for missing NULL terminators in of_device_id tables
    scripts/tags.sh: ignore symlink'ed source files
    scripts/tags.sh: add regular expression replacement pattern for memcg
    builddeb: add arm64 in the supported architectures
    builddeb: use $OBJCOPY variable instead of objcopy
    scripts/tags.sh: ignore code of user space tools
    scripts/tags.sh: add pattern for DEFINE_HASHTABLE
    .gitignore: ignore Module.symvers in all directories

    Linus Torvalds
     

10 Jun, 2014

3 commits


30 Apr, 2014

1 commit


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
     

21 Dec, 2013

1 commit

  • Currently localmodconfig will miss dependencies from the default option.
    For example:

    config FOO
    default y if BAR || ZOO

    If FOO is needed for a module and is set to '=m', and so are BAR or ZOO,
    localmodconfig will not see that BOO or ZOO are also needed for the foo
    module, and will incorrectly disable them.

    Link: http://lkml.kernel.org/r/20131218175137.162937350@goodmis.org

    Signed-off-by: Steven Rostedt

    Steven Rostedt (Red Hat)
     

09 Oct, 2013

4 commits

  • Currently the qconf program invoked by 'make xconfig' stores GUI
    settings in the file ~/.config/Unknown\ Organization.conf. This name
    is apparently generated by the QSettings class when no organisation
    or application name are specified.

    This is obviously not a sensible filename (nor does it seem sensible
    that these QSettings parameters are optional!). Pass the names
    'kernel.org' and 'qconf', resuling in the filename
    ~/.config/kernel.org/qconf.conf.

    Signed-off-by: Ben Hutchings
    Reviewed-by: "Yann E. MORIN"
    Tested-by: "Yann E. MORIN"
    Signed-off-by: "Yann E. MORIN"

    Ben Hutchings
     
  • The struct gstr has a capacity that may differ from the actual string length.

    However, a string manipulation in the function search_conf made the assumption
    that it is the same, which led to messing up some search results, especially
    when the content of the gstr in use had not yet reached at least 63 chars.

    Signed-off-by: Martin Walch
    Acked-by: Wang YanQing
    Acked-by: Benjamin Poirier
    Reviewed-by: "Yann E. MORIN"
    Signed-off-by: "Yann E. MORIN"

    Martin Walch
     
  • The definition ws [ \n\t] is not used anywhere. Drop it to avoid confusion.

    As it is a dead definition, any changes in the resulting code generated by
    flex would be surprising (actually testing this showed that there are really
    no changes). So, there is no need to touch the existing zconf.lex.c_shipped.

    Signed-off-by: Martin Walch
    Reviewed-by: "Yann E. MORIN"
    Signed-off-by: "Yann E. MORIN:

    Martin Walch
     
  • Each symbol must have exactly one type assigned. However, if a symbol happens
    to have two different types assigned at runtime, a warning is printed and the
    first type is preserved while the second type is being ignored.

    The warning message says

    type of redefined from to

    which may be misleading as it may create the impression that the second type
    replaces the first type.

    This patch clarifies this by changing the warning to

    ignoring type redefinition of from to

    Signed-off-by: Martin Walch
    Acked-by: Wang YanQing
    Reviewed-by: "Yann E. MORIN"
    Signed-off-by: "Yann E. MORIN"

    Martin Walch