Skip to content
Snippets Groups Projects
  1. May 01, 2021
  2. Jan 15, 2020
  3. Jan 14, 2020
  4. Jan 03, 2020
    • Masahiro Yamada's avatar
      gen_initramfs_list.sh: fix 'bad variable name' error · cc976614
      Masahiro Yamada authored
      
      Prior to commit 858805b3 ("kbuild: add $(BASH) to run scripts with
      bash-extension"), this shell script was almost always run by bash since
      bash is usually installed on the system by default.
      
      Now, this script is run by sh, which might be a symlink to dash. On such
      distributions, the following code emits an error:
      
        local dev=`LC_ALL=C ls -l "${location}"`
      
      You can reproduce the build error, for example by setting
      CONFIG_INITRAMFS_SOURCE="/dev".
      
          GEN     usr/initramfs_data.cpio.gz
        ./usr/gen_initramfs_list.sh: 131: local: 1: bad variable name
        make[1]: *** [usr/Makefile:61: usr/initramfs_data.cpio.gz] Error 2
      
      This is because `LC_ALL=C ls -l "${location}"` contains spaces.
      Surrounding it with double-quotes fixes the error.
      
      Fixes: 858805b3 ("kbuild: add $(BASH) to run scripts with bash-extension")
      Reported-by: default avatarJory A. Pratt <anarchy@gentoo.org>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      cc976614
  5. Aug 22, 2018
  6. Mar 25, 2018
  7. Jul 06, 2017
  8. Jul 02, 2017
  9. Sep 23, 2016
  10. Aug 20, 2014
  11. Mar 04, 2014
    • Daniel M. Weeks's avatar
      scripts/gen_initramfs_list.sh: fix flags for initramfs LZ4 compression · 5ec384d4
      Daniel M. Weeks authored
      
      LZ4 as implemented in the kernel differs from the default method now
      used by the reference implementation of LZ4.  Until the in-kernel method
      is updated to support the new default, passing the legacy flag (-l) to
      the compressor is necessary.  Without this flag the kernel-generated,
      LZ4-compressed initramfs is junk.
      
      Kyungsik said:
      
      : It seems that lz4 supports legacy format with the same option as lz4c
      : does.  Just looking at the first few bytes of lz4 compressed image, we can
      : see whether it is new format or not.
      :
      : It shows new format magic number without this patch.  New format magic
      : number is 0x184d2204.
      :
      : $ hexdump -C ./initramfs_data.cpio.lz4 |more
      : 00000000  04 22 4d 18 64 70 b9 69 (Little Endian)
      : ...
      :
      : Currently kernel supports legacy format only.
      
      Signed-off-by: default avatarDaniel M. Weeks <dan@danweeks.net>
      Cc: Michal Marek <mmarek@suse.cz>
      Acked-by: default avatarKyungsik Lee <kyungsik.lee@lge.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5ec384d4
  12. Nov 13, 2013
    • P J P's avatar
      initramfs: read CONFIG_RD_ variables for initramfs compression · 9ba4bcb6
      P J P authored
      
      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: default avatarP J P <prasad@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9ba4bcb6
  13. May 12, 2011
  14. Apr 18, 2011
  15. Mar 31, 2011
  16. Jan 13, 2011
    • Lasse Collin's avatar
      decompressors: add boot-time XZ support · 3ebe1243
      Lasse Collin authored
      
      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: default avatarLasse 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: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3ebe1243
  17. May 27, 2010
  18. Mar 23, 2010
  19. Apr 11, 2009
    • Maxime Bizon's avatar
      kbuild: fix spurious initramfs rebuild · 9e5ec861
      Maxime Bizon authored and Sam Ravnborg's avatar Sam Ravnborg committed
      
      When gen_initramfs_list is used to generate make dependencies, it
      includes symbolic links, for which make tracks the link target. Any
      change to that target will cause an initramfs rebuild, even if the
      symlink points to something outside of the initramfs directory.
      
      If the target happens to be /tmp, the rebuild occurs for each kernel
      build, since gen_initramfs_list uses mktemp...
      
      Proposed way to fix it is to omit symbolic links from generated
      dependencies, but this has a small drawback: changing perm/owner on a
      symlink will go unnoticed.
      
      Signed-off-by: default avatarMaxime Bizon <mbizon@freebox.fr>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      9e5ec861
  20. Feb 19, 2009
  21. Jan 07, 2009
    • Alain Knaff's avatar
      bzip2/lzma: fix built-in initramfs vs CONFIG_RD_GZIP · a26ee60f
      Alain Knaff authored and H Peter Anvin's avatar H Peter Anvin committed
      
      Impact: Resolves build failures in some configurations
      
      Makes it possible to disable CONFIG_RD_GZIP . In that case, the
      built-in initramfs will be compressed by whatever compressor is
      available (bzip2 or lzma) or left uncompressed if none is available.
      
      It also removes a couple of warnings which occur when no ramdisk
      compression at all is chosen.
      
      It also restores the select ZLIB_INFLATE in drivers/block/Kconfig
      which somehow came missing. This is needed to activate compilation of
      the stuff in zlib_deflate.
      
      Signed-off-by: default avatarAlain Knaff <alain@knaff.lu>
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      a26ee60f
  22. Apr 28, 2008
  23. Jul 16, 2007
  24. May 02, 2007
    • Michael Ellerman's avatar
      kbuild: propagate errors from find in scripts/gen_initramfs_list.sh · eda890af
      Michael Ellerman authored and Sam Ravnborg's avatar Sam Ravnborg committed
      
      If the find(1) in scripts/gen_initramfs_list.sh generates any errors, it
      will cause gen_initramfs_list.sh to fail (because of "set -e"), however
      the errors from find are not printed to the user. This is rather confusing:
      
      ~/src/powerpc$ make O=~/build/powerpc-cell32/
      make[2]: *** [usr/initramfs_data.cpio.gz] Error 1
      make[1]: *** [usr] Error 2
      make[1]: *** Waiting for unfinished jobs....
      make[1]: *** wait: No child processes.  Stop.
      make: *** [_all] Error 2
      
      It is much easier to work out what the problem is if we let the errors
      from find hit the console, eg:
      
      ~/src/powerpc$ make O=~/build/powerpc-cell32/
      find: /home/michael/initramfs-source/home: Permission denied
      find: /home/michael/initramfs-source/lost+found: Permission denied
      find: /home/michael/initramfs-source/opt: Permission denied
      find: /home/michael/initramfs-source/root: Permission denied
      make[2]: *** [usr/initramfs_data.cpio.gz] Error 1
      make[1]: *** [usr] Error 2
      make[1]: *** Waiting for unfinished jobs....
      make[1]: *** wait: No child processes.  Stop.
      make: *** [_all] Error 2
      
      Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      eda890af
    • Alex Landau's avatar
      kbuild: handle compressed cpio initramfs-es · c299ec2d
      Alex Landau authored and Sam Ravnborg's avatar Sam Ravnborg committed
      
      Make kbuild handle compressed cpio initramfs-es.  An already compressed
      cpio is copied directly to usr/, while a non-compressed cpio is filtered
      through gzip (no changes here) on its way to usr/.
      
      If the user has created a compressed cpio by other means, this saves him
      from uncompressing it, just to be compressed again by kbuild.
      
      Signed-off-by: default avatarAlex Landau <landau.alex@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      c299ec2d
  25. Feb 06, 2007
  26. Nov 25, 2006
  27. Apr 30, 2006
  28. Apr 11, 2006
    • Sam Ravnborg's avatar
      kbuild: rebuild initramfs if content of initramfs changes · d39a206b
      Sam Ravnborg authored
      
      initramfs.cpio.gz being build in usr/ and included in the
      kernel was not rebuild when the included files changed.
      
      To fix this the following was done:
      - let gen_initramfs.sh generate a list of files and directories included
        in the initramfs
      - gen_initramfs generate the gzipped cpio archive so we could simplify
        the kbuild file (Makefile)
      - utilising the kbuild infrastructure so when uid/gid root mapping changes
        the initramfs will be rebuild
      
      With this change we have a much more robust initramfs generation.
      
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      d39a206b
  29. Apr 16, 2005
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds authored
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4
Loading