1. 05 10月, 2019 1 次提交
  2. 25 9月, 2019 2 次提交
    • M
      netfilter: ebtables: use __u8 instead of uint8_t in uapi header · 20ff1cb5
      Masahiro Yamada 提交于
      When CONFIG_UAPI_HEADER_TEST=y, exported headers are compile-tested to
      make sure they can be included from user-space.
      
      Currently, linux/netfilter_bridge/ebtables.h is excluded from the test
      coverage. To make it join the compile-test, we need to fix the build
      errors attached below.
      
      For a case like this, we decided to use __u{8,16,32,64} variable types
      in this discussion:
      
        https://lkml.org/lkml/2019/6/5/18
      
      Build log:
      
        CC      usr/include/linux/netfilter_bridge/ebtables.h.s
      In file included from <command-line>:32:0:
      ./usr/include/linux/netfilter_bridge/ebtables.h:126:4: error: unknown type name ‘uint8_t’
          uint8_t revision;
          ^~~~~~~
      ./usr/include/linux/netfilter_bridge/ebtables.h:139:4: error: unknown type name ‘uint8_t’
          uint8_t revision;
          ^~~~~~~
      ./usr/include/linux/netfilter_bridge/ebtables.h:152:4: error: unknown type name ‘uint8_t’
          uint8_t revision;
          ^~~~~~~
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      20ff1cb5
    • G
      kbuild: clean compressed initramfs image · 6279eb3d
      Greg Thelen 提交于
      Since 9e3596b0 ("kbuild: initramfs cleanup, set target from Kconfig")
      "make clean" leaves behind compressed initramfs images.  Example:
      
        $ make defconfig
        $ sed -i 's|CONFIG_INITRAMFS_SOURCE=""|CONFIG_INITRAMFS_SOURCE="/tmp/ir.cpio"|' .config
        $ make olddefconfig
        $ make -s
        $ make -s clean
        $ git clean -ndxf | grep initramfs
        Would remove usr/initramfs_data.cpio.gz
      
      clean rules do not have CONFIG_* context so they do not know which
      compression format was used.  Thus they don't know which files to delete.
      
      Tell clean to delete all possible compression formats.
      
      Once patched usr/initramfs_data.cpio.gz and friends are deleted by
      "make clean".
      
      Link: http://lkml.kernel.org/r/20190722063251.55541-1-gthelen@google.com
      Fixes: 9e3596b0 ("kbuild: initramfs cleanup, set target from Kconfig")
      Signed-off-by: NGreg Thelen <gthelen@google.com>
      Cc: Nicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6279eb3d
  3. 29 8月, 2019 1 次提交
  4. 23 7月, 2019 1 次提交
  5. 20 7月, 2019 1 次提交
    • M
      kbuild: update compile-test header list for v5.3-rc1 · 67bf4745
      Masahiro Yamada 提交于
       - Some headers graduated from the blacklist
      
       - hyperv_timer.h joined the header-test when CONFIG_X86=y
      
       - nf_tables*.h joined the header-test when CONFIG_NF_TABLES is
         enabled.
      
       - The entry for nf_tables_offload.h was added to fix build error for
         the combination of CONFIG_NF_TABLES=n and CONFIG_KERNEL_HEADER_TEST=y.
      
       - The entry for iomap.h was added because this header is supposed to
         be included only when CONFIG_BLOCK=y
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      67bf4745
  6. 15 7月, 2019 2 次提交
  7. 08 7月, 2019 1 次提交
    • M
      kbuild: compile-test exported headers to ensure they are self-contained · d6fc9fcb
      Masahiro Yamada 提交于
      Multiple people have suggested compile-testing UAPI headers to ensure
      they can be really included from user-space. "make headers_check" is
      obviously not enough to catch bugs, and we often leak unresolved
      references to user-space.
      
      Use the new header-test-y syntax to implement it. Please note exported
      headers are compile-tested with a completely different set of compiler
      flags. The header search path is set to $(objtree)/usr/include since
      exported headers should not include unexported ones.
      
      We use -std=gnu89 for the kernel space since the kernel code highly
      depends on GNU extensions. On the other hand, UAPI headers should be
      written in more standardized C, so they are compiled with -std=c90.
      This will emit errors if C++ style comments, the keyword 'inline', etc.
      are used. Please use C style comments (/* ... */), '__inline__', etc.
      in UAPI headers.
      
      There is additional compiler requirement to enable this test because
      many of UAPI headers include <stdlib.h>, <sys/ioctl.h>, <sys/time.h>,
      etc. directly or indirectly. You cannot use kernel.org pre-built
      toolchains [1] since they lack <stdlib.h>.
      
      I reused CONFIG_CC_CAN_LINK to check the system header availability.
      The intention is slightly different, but a compiler that can link
      userspace programs provide system headers.
      
      For now, a lot of headers need to be excluded because they cannot
      be compiled standalone, but this is a good start point.
      
      [1] https://mirrors.edge.kernel.org/pub/tools/crosstool/index.htmlSigned-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Reviewed-by: NSam Ravnborg <sam@ravnborg.org>
      d6fc9fcb
  8. 10 12月, 2018 1 次提交
  9. 22 8月, 2018 2 次提交
  10. 26 3月, 2018 1 次提交
    • N
      kbuild: rename built-in.o to built-in.a · f49821ee
      Nicholas Piggin 提交于
      Incremental linking is gone, so rename built-in.o to built-in.a, which
      is the usual extension for archive files.
      
      This patch does two things, first is a simple search/replace:
      
      git grep -l 'built-in\.o' | xargs sed -i 's/built-in\.o/built-in\.a/g'
      
      The second is to invert nesting of nested text manipulations to avoid
      filtering built-in.a out from libs-y2:
      
      -libs-y2 := $(filter-out %.a, $(patsubst %/, %/built-in.a, $(libs-y)))
      +libs-y2 := $(patsubst %/, %/built-in.a, $(filter-out %.a, $(libs-y)))
      Signed-off-by: NNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      f49821ee
  11. 03 11月, 2017 1 次提交
  12. 02 11月, 2017 1 次提交
    • G
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman 提交于
      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
         lines).
      
      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: NKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: NPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
  13. 07 7月, 2017 2 次提交
  14. 03 6月, 2017 1 次提交
    • F
      initramfs: fix disabling of initramfs (and its compression) · 57ddfdaa
      Florian Fainelli 提交于
      Commit db2aa7fd ("initramfs: allow again choice of the embedded
      initram compression algorithm") introduced the possibility to select the
      initramfs compression algorithm from Kconfig and while this is a nice
      feature it broke the use case described below.
      
      Here is what my build system does:
      
       - kernel is initially configured not to have an initramfs included
      
       - build the user space root file system
      
       - re-configure the kernel to have an initramfs included
         (CONFIG_INITRAMFS_SOURCE="/path/to/romfs") and set relevant
         CONFIG_INITRAMFS options, in my case, no compression option
         (CONFIG_INITRAMFS_COMPRESSION_NONE)
      
       - kernel is re-built with these options -> kernel+initramfs image is
         copied
      
       - kernel is re-built again without these options -> kernel image is
         copied
      
      Building a kernel without an initramfs means setting this option:
      
        CONFIG_INITRAMFS_SOURCE="" (and this one only)
      
      whereas building a kernel with an initramfs means setting these options:
      
        CONFIG_INITRAMFS_SOURCE="/home/fainelli/work/uclinux-rootfs/romfs /home/fainelli/work/uclinux-rootfs/misc/initramfs.dev"
        CONFIG_INITRAMFS_ROOT_UID=1000
        CONFIG_INITRAMFS_ROOT_GID=1000
        CONFIG_INITRAMFS_COMPRESSION_NONE=y
        CONFIG_INITRAMFS_COMPRESSION=""
      
      Commit db2aa7fd ("initramfs: allow again choice of the embedded
      initram compression algorithm") is problematic because
      CONFIG_INITRAMFS_COMPRESSION which is used to determine the
      initramfs_data.cpio extension/compression is a string, and due to how
      Kconfig works it will evaluate in order, how to assign it.
      
      Setting CONFIG_INITRAMFS_COMPRESSION_NONE with CONFIG_INITRAMFS_SOURCE=""
      cannot possibly work (because of the depends on INITRAMFS_SOURCE!=""
      imposed on CONFIG_INITRAMFS_COMPRESSION ) yet we still get
      CONFIG_INITRAMFS_COMPRESSION assigned to ".gz" because CONFIG_RD_GZIP=y
      is set in my kernel, even when there is no initramfs being built.
      
      So we basically end-up generating two initramfs_data.cpio* files, one
      without extension, and one with .gz.  This causes usr/Makefile to track
      usr/initramfs_data.cpio.gz, and not usr/initramfs_data.cpio anymore,
      that is also largely problematic after 9e3596b0 ("kbuild:
      initramfs cleanup, set target from Kconfig") because we used to track
      all possible initramfs_data files in the $(targets) variable before that
      commit.
      
      The end result is that the kernel with an initramfs clearly does not
      contain what we expect it to, it has a stale initramfs_data.cpio file
      built into it, and we keep re-generating an initramfs_data.cpio.gz file
      which is not the one that we want to include in the kernel image proper.
      
      The fix consists in hiding CONFIG_INITRAMFS_COMPRESSION when
      CONFIG_INITRAMFS_SOURCE="".  This puts us back in a state to the
      pre-4.10 behavior where we can properly disable and re-enable initramfs
      within the same kernel .config file, and be in control of what
      CONFIG_INITRAMFS_COMPRESSION is set to.
      
      Fixes: db2aa7fd ("initramfs: allow again choice of the embedded initram compression algorithm")
      Fixes: 9e3596b0 ("kbuild: initramfs cleanup, set target from Kconfig")
      Link: http://lkml.kernel.org/r/20170521033337.6197-1-f.fainelli@gmail.comSigned-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Acked-by: NNicholas Piggin <npiggin@gmail.com>
      Cc: P J P <ppandit@redhat.com>
      Cc: Paul Bolle <pebolle@tiscali.nl>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Daniel Thompson <daniel.thompson@linaro.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      57ddfdaa
  15. 09 5月, 2017 1 次提交
  16. 06 1月, 2017 2 次提交
  17. 15 12月, 2016 2 次提交
  18. 14 12月, 2014 1 次提交
    • A
      usr/Kconfig: make initrd compression algorithm selection not expert · ec72c666
      Andi Kleen 提交于
      The kernel has support for (nearly) every compression algorithm known to
      man, each to handle some particular microscopic niche.
      
      Unfortunately all of these always get compiled in if you want to support
      INITRDs, and can be only disabled when CONFIG_EXPERT is set.
      
      I don't see why I need to set EXPERT just to properly configure the initrd
      compression algorithms, and not always include every possible algorithm
      
      Usually the initrd is just compressed with gzip anyways, at least that's
      true on all distributions I use.
      
      Remove the dependencies for initrd compression on CONFIG_EXPERT.
      
      Make the various options just default y, which should be good enough to
      not break any previous configuration.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ec72c666
  19. 07 6月, 2014 1 次提交
  20. 13 11月, 2013 2 次提交
    • P
      initramfs: read CONFIG_RD_ variables for initramfs compression · 9ba4bcb6
      P J P 提交于
      When expert configuration option(CONFIG_EXPERT) is enabled, menuconfig
      offers a choice of compression algorithm to compress initial ramfs image;
      This choice is stored into CONFIG_RD_* variables.  But usr/Makefile uses
      earlier INITRAMFS_COMPRESSION_* macros to build initial ramfs file.  Since
      none of them is defined, resulting 'initramfs_data.cpio' file remains
      un-compressed.
      
      This patch updates the Makefile to use CONFIG_RD_* variables and adds
      support for LZ4 compression algorithm.  Also updates the
      'gen_initramfs_list.sh' script to check whether a selected compression
      command is accessible or not.  And fall-back to default gzip(1)
      compression when it is not.
      Signed-off-by: NP J P <prasad@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9ba4bcb6
    • M
      gen_init_cpio: avoid NULL pointer dereference and rework env expanding · c725ee54
      Michal Nazarewicz 提交于
      getenv() may return NULL if given environment variable does not exist
      which leads to NULL dereference when calling strncat.
      
      Besides that, the environment variable name was copied to a temporary
      env_var buffer, but this copying can be avoided by simply using the input
      string.
      
      Lastly, the whole loop can be greatly simplified by using the snprintf
      function instead of the playing with strncat.
      
       By the way, the current implementation allows a recursive variable
       expansion, as in:
      
         $ echo 'out ${A} out ' | A='a ${B} a' B=b /tmp/a
         out a b a out
      
       I'm assuming this is just a side effect and not a conscious decision
       (especially as this may lead to infinite loop), but I didn't want to
       change this behaviour without consulting.
      
       If the current behaviour is deamed incorrect, I'll be happy to send
       a patch without recursive processing.
      Signed-off-by: NMichal Nazarewicz <mina86@mina86.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Jesper Juhl <jj@codesealer.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c725ee54
  21. 10 7月, 2013 1 次提交
  22. 19 11月, 2012 1 次提交
  23. 26 10月, 2012 1 次提交
    • K
      gen_init_cpio: avoid stack overflow when expanding · 20f1de65
      Kees Cook 提交于
      Fix possible overflow of the buffer used for expanding environment
      variables when building file list.
      
      In the extremely unlikely case of an attacker having control over the
      environment variables visible to gen_init_cpio, control over the
      contents of the file gen_init_cpio parses, and gen_init_cpio was built
      without compiler hardening, the attacker can gain arbitrary execution
      control via a stack buffer overflow.
      
        $ cat usr/crash.list
        file foo ${BIG}${BIG}${BIG}${BIG}${BIG}${BIG} 0755 0 0
        $ BIG=$(perl -e 'print "A" x 4096;') ./usr/gen_init_cpio usr/crash.list
        *** buffer overflow detected ***: ./usr/gen_init_cpio terminated
      
      This also replaces the space-indenting with tabs.
      
      Patch based on existing fix extracted from grsecurity.
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Brad Spengler <spender@grsecurity.net>
      Cc: PaX Team <pageexec@freemail.hu>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      20f1de65
  24. 01 6月, 2012 1 次提交
  25. 18 4月, 2011 1 次提交
  26. 21 1月, 2011 1 次提交
    • D
      kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT · 6a108a14
      David Rientjes 提交于
      The meaning of CONFIG_EMBEDDED has long since been obsoleted; the option
      is used to configure any non-standard kernel with a much larger scope than
      only small devices.
      
      This patch renames the option to CONFIG_EXPERT in init/Kconfig and fixes
      references to the option throughout the kernel.  A new CONFIG_EMBEDDED
      option is added that automatically selects CONFIG_EXPERT when enabled and
      can be used in the future to isolate options that should only be
      considered for embedded systems (RISC architectures, SLOB, etc).
      
      Calling the option "EXPERT" more accurately represents its intention: only
      expert users who understand the impact of the configuration changes they
      are making should enable it.
      Reviewed-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NDavid Woodhouse <david.woodhouse@intel.com>
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Cc: Greg KH <gregkh@suse.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Robin Holt <holt@sgi.com>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6a108a14
  27. 14 1月, 2011 1 次提交
    • L
      decompressors: add boot-time XZ support · 3ebe1243
      Lasse Collin 提交于
      This implements the API defined in <linux/decompress/generic.h> which is
      used for kernel, initramfs, and initrd decompression.  This patch together
      with the first patch is enough for XZ-compressed initramfs and initrd;
      XZ-compressed kernel will need arch-specific changes.
      
      The buffering requirements described in decompress_unxz.c are stricter
      than with gzip, so the relevant changes should be done to the
      arch-specific code when adding support for XZ-compressed kernel.
      Similarly, the heap size in arch-specific pre-boot code may need to be
      increased (30 KiB is enough).
      
      The XZ decompressor needs memmove(), memeq() (memcmp() == 0), and
      memzero() (memset(ptr, 0, size)), which aren't available in all
      arch-specific pre-boot environments.  I'm including simple versions in
      decompress_unxz.c, but a cleaner solution would naturally be nicer.
      Signed-off-by: NLasse Collin <lasse.collin@tukaani.org>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Alain Knaff <alain@knaff.lu>
      Cc: Albin Tonnerre <albin.tonnerre@free-electrons.com>
      Cc: Phillip Lougher <phillip@lougher.demon.co.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3ebe1243
  28. 06 1月, 2011 1 次提交
  29. 29 12月, 2010 1 次提交
  30. 02 12月, 2010 1 次提交
    • T
      gen_init_cpio: remove leading `/' from file names · 43f901fb
      Thomas Chou 提交于
      When we extracted the generated cpio archive using "cpio -id" command,
      it complained,
      
      cpio: Removing leading `/' from member names
      var/run
      cpio: Removing leading `/' from member names
      var/lib
      cpio: Removing leading `/' from member names
      var/lib/misc
      
      It is worse with the latest "cpio" or "pax", which tries to overwrite
      the host file system with the leading '/'.
      
      So the leading '/' of file names should be removed. This is consistent
      with the initramfs come with major distributions such as Fedora or
      Debian, etc.
      Signed-off-by: NThomas Chou <thomas@wytron.com.tw>
      Acked-by: Mike Frysinger<vapier@gentoo.org>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      43f901fb
  31. 01 12月, 2010 1 次提交
  32. 31 10月, 2010 1 次提交
    • G
      initramfs: Fix initramfs size for 32-bit arches · 96f93593
      Geert Uytterhoeven 提交于
      Commit ffe8018c ("initramfs: fix initramfs size calculation") broke
      32-bit big-endian arches like (on ARAnyM):
      
          VFS: Cannot open root device "hda1" or unknown-block(3,1)
          Please append a correct "root=" boot option; here are the available partitions:
          fe80         1059408 nfhd8  (driver?)
            fe81          921600 nfhd8p1 00000000-0000-0000-0000-000000000nfhd8p1
            fe82          137807 nfhd8p2 00000000-0000-0000-0000-000000000nfhd8p2
          0200            3280 fd0  (driver?)
          0201            3280 fd1  (driver?)
          0300         1059408 hda  driver: ide-gd
            0301          921600 hda1 00000000-0000-0000-0000-000000000hda1
            0302          137807 hda2 00000000-0000-0000-0000-000000000hda2
          Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(3,1)
      
      As pointed out by Kerstin Jonsson <kerstin.jonsson@ericsson.com>, this
      is due to CONFIG_32BIT not being defined, so the initramfs size field is
      done as a 64-bit quad.  On little-endian (like x86) this doesn matter,
      but on a big-endian machine the 32-bit reads will see the (zero) high
      bits.
      
      Only mips, s390, and score set CONFIG_32BIT for 32-bit builds, so fix it for
      all other 32-bit arches by inverting the logic and testing for CONFIG_64BIT,
      which should be defined on all 64-bit arches.
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      [ I think we should just make it "u64" on all architectures and get
        rid of the whole #ifdef CONFIG_xxBIT   - Linus ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      96f93593
  33. 29 9月, 2010 1 次提交
    • H
      initramfs: fix initramfs size calculation · ffe8018c
      Hendrik Brueckner 提交于
      The size of a built-in initramfs is calculated in init/initramfs.c by
      "__initramfs_end - __initramfs_start".  Those symbols are defined in the
      linker script include/asm-generic/vmlinux.lds.h:
      
      #define INIT_RAM_FS                                                     \
              . = ALIGN(PAGE_SIZE);                                           \
              VMLINUX_SYMBOL(__initramfs_start) = .;                          \
              *(.init.ramfs)                                                  \
              VMLINUX_SYMBOL(__initramfs_end) = .;
      
      If the initramfs file has an odd number of bytes, the "__initramfs_end"
      symbol points to an odd address, for example, the symbols in the
      System.map might look like:
      
          0000000000572000 T __initramfs_start
          00000000005bcd05 T __initramfs_end	  <-- odd address
      
      At least on s390 this causes a problem:
      
      Certain s390 instructions, especially instructions for loading addresses
      (larl) or branch addresses must be on even addresses.  The compiler loads
      the symbol addresses with the "larl" instruction.  This instruction sets
      the last bit to 0 and, therefore, for odd size files, the calculated size
      is one byte less than it should be:
      
          0000000000540a9c <populate_rootfs>:
            540a9c:     eb cf f0 78 00 24       stmg    %r12,%r15,120(%r15),
            540aa2:     c0 10 00 01 8a af       larl    %r1,572000 <__initramfs_start>
            540aa8:     c0 c0 00 03 e1 2e       larl    %r12,5bcd04 <initramfs_end>
                                                        (Instead of  5bcd05)
            ...
            540abe:     1b c1                   sr      %r12,%r1
      
      To fix the problem, this patch introduces the global variable
      __initramfs_size, which is calculated in the "usr/initramfs_data.S" file.
      The populate_rootfs() function can then use the start marker of the
      .init.ramfs section and the value of __initramfs_size for loading the
      initramfs.  Because the start marker and size is sufficient, the
      __initramfs_end symbol is no longer needed and is removed.
      Signed-off-by: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: NHendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Reviewed-by: NWANG Cong <xiyou.wangcong@gmail.com>
      Acked-by: NMichal Marek <mmarek@suse.cz>
      Acked-by: N"H. Peter Anvin" <hpa@zytor.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      ffe8018c