1. 02 Nov, 2017 1 commit
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      How this work was done:
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
      All documentation files were explicitly excluded.
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
         For non */uapi/* files that summary was:
         SPDX license identifier                            # files
         GPL-2.0                                              11139
         and resulted in the first patch in this series.
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
         SPDX license identifier                            # files
         GPL-2.0 WITH Linux-syscall-note                        930
         and resulted in the second patch in this series.
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
         SPDX license identifier                            # files
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
         and that resulted in the third patch in this series.
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      Reviewed-by: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: default avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
  2. 11 Jul, 2017 2 commits
  3. 09 Jul, 2017 2 commits
  4. 21 Jun, 2017 1 commit
  5. 17 May, 2017 1 commit
    • Masahiro Yamada's avatar
      kbuild: skip install/check of headers right under uapi directories · 05d8cba4
      Masahiro Yamada authored
      Since commit 61562f98 ("uapi: export all arch specifics
      directories"), "make INSTALL_HDR_PATH=$root/usr headers_install"
      deletes standard glibc headers and others in $(root)/usr/include.
      The cause of the issue is that headers_install now starts descending
      from arch/$(hdr-arch)/include/uapi with $(root)/usr/include for its
      destination when installing asm headers.  So, headers already there
      are assumed to be unwanted.
      When headers_install starts descending from include/uapi with
      $(root)/usr/include for its destination, it works around the problem
      by creating an dummy destination $(root)/usr/include/uapi, but this
      is tricky.
      To fix the problem in a clean way is to skip headers install/check
      in include/uapi and arch/$(hdr-arch)/include/uapi because we know
      there are only sub-directories in uapi directories.  A good side
      effect is the empty destination $(root)/usr/include/uapi will go
      I am also removing the trailing slash in the headers_check target to
      skip checking in arch/$(hdr-arch)/include/uapi.
      Fixes: 61562f98 ("uapi: export all arch specifics directories")
      Reported-by: default avatarDan Williams <dan.j.williams@intel.com>
      Signed-off-by: Masahiro Yamada's avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Tested-by: default avatarDan Williams <dan.j.williams@intel.com>
      Acked-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
  6. 10 May, 2017 4 commits
    • Nicolas Dichtel's avatar
      uapi: export all arch specifics directories · 61562f98
      Nicolas Dichtel authored
      This patch removes the need of subdir-y. Now all files/directories under
      arch/<arch>/include/uapi/ are exported.
      The only change for userland is the layout of the command 'make
      headers_install_all': directories asm-<arch> are replaced by arch-<arch>/.
      Those new directories contains all files/directories of the specified arch.
      Note that only cris and tile have more directories than only asm:
       - arch-v[10|32] for cris;
       - arch for tile.
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: Masahiro Yamada's avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    • Nicolas Dichtel's avatar
      uapi: export all headers under uapi directories · fcc8487d
      Nicolas Dichtel authored
      Regularly, when a new header is created in include/uapi/, the developer
      forgets to add it in the corresponding Kbuild file. This error is usually
      detected after the release is out.
      In fact, all headers under uapi directories should be exported, thus it's
      useless to have an exhaustive list.
      After this patch, the following files, which were not exported, are now
      exported (with make headers_install_all):
      Note that I have removed from this list the files which are generated in every
      exported directories (like .install or .install.cmd).
      Thanks to Julien Floret <julien.floret@6wind.com> for the tip to get all
      subdirs with a pure makefile command.
      For the record, note that exported files for asm directories are a mix of
      files listed by:
       - include/uapi/asm-generic/Kbuild.asm;
       - arch/<arch>/include/uapi/asm/Kbuild;
       - arch/<arch>/include/asm/Kbuild.
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Acked-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Acked-by: default avatarMark Salter <msalter@redhat.com>
      Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
      Signed-off-by: Masahiro Yamada's avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    • Nicolas Dichtel's avatar
      Makefile.headersinst: remove destination-y option · bd73a328
      Nicolas Dichtel authored
      This option was added in commit c7bb349e ("kbuild: introduce destination-y
      for exported headers") but never used in-tree.
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Acked-by: default avatarPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: Masahiro Yamada's avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    • Nicolas Dichtel's avatar
      Makefile.headersinst: cleanup input files · 7c025b2a
      Nicolas Dichtel authored
      After the last three patches, all exported headers are under uapi/, thus
      input-files2 are not needed anymore.
      The side effect is that input-files1-name is exactly header-y.
      Note also that input-files3-name is genhdr-y.
      Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: Masahiro Yamada's avatarMasahiro Yamada <yamada.masahiro@socionext.com>
  7. 26 Nov, 2014 1 commit
  8. 17 May, 2013 1 commit
  9. 09 Apr, 2013 1 commit
  10. 05 Mar, 2013 1 commit
  11. 22 Feb, 2013 1 commit
    • Jesper Nilsson's avatar
      kbuild: Fix destination-y for installed headers · 9b58b928
      Jesper Nilsson authored
      Commit 10b63956 which plumbed in UAPI
      broke the destination-y functionality of scripts/Makefile.headersinst.
      The variable destination-y is used in a := assignment and so is expanded at
      declaration time, and the include of the Kbuild fragments that set
      destination-y to something is after this time, so it now always expands empty.
      There are no in-tree users of destination-y, but it allows any
      Kbuild-fragment to redirect where headers are installed.
      Just move the assignment of the variable that uses it below the include
      of the Kbuild fragment.
      Signed-off-by: default avatarJesper Nilsson <jesper.nilsson@axis.com>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
  12. 02 Oct, 2012 2 commits
  13. 17 Nov, 2011 1 commit
  14. 28 Apr, 2011 1 commit
    • Sam Ravnborg's avatar
      kbuild: asm-generic support · d8ecc5cd
      Sam Ravnborg authored
      There is an increasing amount of header files
      shared between individual architectures in asm-generic.
      To avoid a lot of dummy wrapper files that just
      include the corresponding file in asm-generic provide
      some basic support in kbuild for this.
      With the following patch an architecture can maintain
      a list of files in the file arch/$(ARCH)/include/asm/Kbuild
      To use a generic file just add:
              generic-y += <name-of-header-file.h>
      For each file listed kbuild will generate the necessary
      wrapper in arch/$(ARCH)/include/generated/asm.
      When installing userspace headers a wrapper is likewise created.
      The original inspiration for this came from the unicore32
      patchset - although a different method is used.
      The patch includes several improvements from Arnd Bergmann.
      Michael Marek contributed Makefile.asm-generic.
      Remis Baima did an intial implementation along to achive
      the same - see https://patchwork.kernel.org/patch/13352/Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Acked-by: default avatarGuan Xuetao <guanxuetao@mprc.pku.edu.cn>
      Tested-by: default avatarGuan Xuetao <guanxuetao@mprc.pku.edu.cn>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Remis Lima Baima <remis.developer@googlemail.com>
      Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
  15. 14 Aug, 2010 1 commit
  16. 09 Jun, 2009 1 commit
    • Sergei Poselenov's avatar
      kbuild: fix "Argument list too long" error for "make headers_check", · 7211b8b9
      Sergei Poselenov authored
      I'm trying to install kernel headers to build a cross-toolchain, but got
      the following:
      make ARCH=arm
        CHECK   include/linux/raid (2 files)
        CHECK   include/linux/spi (1 files)
        CHECK   include/linux/sunrpc (1 files)
        CHECK   include/linux/tc_act (6 files)
        CHECK   include/linux/tc_ematch (4 files)
        CHECK   include/linux/usb (8 files)
      make[2]: execvp: /bin/sh: Argument list too long
      make[2]: ***
      Error 127
      make[1]: *** [linux] Error 2
      make: *** [headers_check] Error 2
      Introduce use of xargs to fix this.
      Signed-off-by: default avatarSergei Poselenov <sposelenov@emcraft.com>
      Cc: Wolfgang Denk <wd@denx.de>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
  17. 11 Apr, 2009 1 commit
    • Sam Ravnborg's avatar
      kbuild: introduce destination-y for exported headers · c7bb349e
      Sam Ravnborg authored
      xtensa and arm have asked for a possibility to export headers
      and locate them in a specific directory when exported.
      Introduce destiantion-y to support this.
      This patch in additiona adds some limited
      documentation for the variables used for exported headers.
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Cc: Oskar Schirmer <os@emlix.com>
      Cc: Mikael Starvik <mikael.starvik@axis.com>
  18. 25 Jul, 2008 6 commits
    • Sam Ravnborg's avatar
      kbuild: install all headers when arch is changed · db1bec4f
      Sam Ravnborg authored
      We see some header files that are selected dependent on
      the actual architecture so force a reinstallation
      of all header files when the arch changes.
      This slows down "make headers_check_all" but then
      we better reflect reality.
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
    • Sam Ravnborg's avatar
      kbuild: optimize headers_* targets · 7712401a
      Sam Ravnborg authored
      Move the core functionality of headers_install
      and headers_check to two small perl scripts.
      The makefile is adapted to use the perl scrip and
      changed to operate on all files in a directory.
      So if one file is changed then all files in the
      directory is processed.
      perl were chosen for the helper scripts because this
      is pure text processing which perl is good at and
      especially the headers_check.pl script are expected to
      see changes / new checks implmented.
      The speed is ~300% faster on this box.
      And the output generated to the screen is now down to
      two lines per directory (one for install, one for check)
      so it is easier to scroll back after a kernel build.
      The perl scripts has been brought to sanity by patient
      feedback from: Vegard Nossum <vegard.nossum@gmail.com>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
    • Sam Ravnborg's avatar
      kbuild: only one call for include/ in make headers_* · 88181ec3
      Sam Ravnborg authored
      Move it to the top-level file to decide if we install/check
      the generic headers or the arch specific headers.
      This revealed a long standing bug where "make headers_check_all"
      relied on the files in asm/ for the current architecture.
      So make headers_check_all is now broken by this commit.
      In addition:
      o add a simpler way to detect if an arch support
        exporting header files.
      o add 'set -e;' so we error out early if
        make headers_check_all fails.
      o add sparc64 and cris to arch we do not process
        in make headers_*_all because:
          sparc64 - use sparc to export headers
          cris    - is know seriously broken
      Includes suggestions from: David Woodhouse
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Cc: David Woodhouse <dwmw2@infradead.org>
    • Sam Ravnborg's avatar
      kbuild: code refactoring in Makefile.headerinst · 62284a37
      Sam Ravnborg authored
      No functional changes just improved readability
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
    • Sam Ravnborg's avatar
      kbuild: drop support of ALTARCH for headers_* · 283039fb
      Sam Ravnborg authored
      ALTARCH is no longer used by any arch(*) so drop
      support for this from Makefile.headerinst
      Dropping ALTARCH support simplifies Makefile.headerinst
      (*) sparc64 uses it but work is ongoing to drop it
      and no furter usage is planned.
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: David Miller <davem@davemloft.net>
    • Sam Ravnborg's avatar
      kbuild: always unifdef files in headers_install* · 4e420aa9
      Sam Ravnborg authored
      unifdef utility is fast enough to warrant that we always
      run the scripts through unifdef.
      This patch runs all headers listed with header-y and unifdef-y
      through unifdef.
      Next step is to drop unifdef-y in all Kbuild files and
      that can now be done in smaller steps.
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Adrian Bunk <bunk@kernel.org>
  19. 17 Jul, 2007 1 commit
  20. 06 Jul, 2007 1 commit
  21. 29 Jun, 2007 2 commits
  22. 22 May, 2007 1 commit
    • David Woodhouse's avatar
      Make 'headerscheck' stop immediately on an error · df5f6311
      David Woodhouse authored
      This should make it stop immediately after printing the _helpful_ error
      message, rather than continuing to spit out many pages more of 'CHECK
      include/linux/foo.h' before eventually coming to a halt with something
      less obvious.
      Now I get this...
        CHECK   include/linux/smb_fs.h
      /shiny/git/linux-2.6/usr/include/linux/smb_fs.h requires linux/jiffies.h, which does not exist in exported headers
      make[2]: *** [/shiny/git/linux-2.6/usr/include/linux/.check.smb_fs.h] Error 1
      make[1]: *** [linux] Error 2
      make: *** [headers_check] Error 2
      Signed-off-by-if-Sam-says-so: David Woodhouse <dwmw2@infradead.org>
      [ Sam had better say so! This made me waste way too much time. - Linus]
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  23. 31 Jan, 2007 1 commit
  24. 17 Oct, 2006 1 commit
  25. 04 Oct, 2006 1 commit
  26. 25 Sep, 2006 1 commit
  27. 24 Sep, 2006 1 commit
  28. 16 Sep, 2006 1 commit
    • David Woodhouse's avatar
      [PATCH] Fix 'make headers_check' on biarch architectures · b5122177
      David Woodhouse authored
      We generate an <asm/foo.h> which includes either <asm-$ARCH/foo.h> or
      <asm-$ALTARCH/foo.h> as appropriate.  But we were doing this dependent on
      whether the file in question existed in the _unexported_ tree, not the
      exported tree.  So if a file was exported to userspace in one asm- directory
      but not the other, the generated file in asm/ was incorrect.
      This only changed the failure mode if it _was_ included from a nice #error to
      a less explicable #include failure -- but it also gave false errors in 'make
      headers_check' output.  Fix it by looking in the right place instead.
      Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>