Commit Graph

18 Commits

Author SHA1 Message Date
Yureka
0f216e2578 tree-wide: switch initrd generators back to gnu cpio
Originally, we switched to bsdtar from libarchive to solve a reproducibility issue related to hardlinks

As of gnu cpio 2.14 the --ignore-dirnlink option is introduced and now included in --reproducible, which solves this issue

By switching back, we are in turn solving an issue in libarchive >=3.7.5 erroring out with "Error reading archive -: (null)"

Change-Id: Ib6140d599b6547d8e941b0251ce996e303c41fa6
2024-10-31 01:21:59 +01:00
Thomas Watson
7fd6cea253 make-initrd: fix reproducibility problems
cpio includes the number of directory hard links in archives it creates.
Some filesystems, like btrfs, do not count directory hard links the same
way as more common filesystems like ext4 or tmpfs, so archives built
when /tmp is on such a filesystem do not reproduce. This patch replaces
cpio with bsdtar, which does not have this issue. The specific
invocation is from this page:
https://reproducible-builds.org/docs/archives/
2022-04-14 19:06:30 -05:00
Thomas Watson
d8bb89b9ff make-initrd: fix reproducibility problems with hard links 2022-01-29 18:07:11 -05:00
Linus Heckemann
b0fc6e8ff9 make-initrd: fix #132059 2021-08-08 07:53:59 +02:00
Linus Heckemann
14fbf575ec make-initrd: various improvements
- Generate a link to the initramfs file with an appropriate file
  extension, guessed based on the compressor by default
- Use correct metadata in u-boot images if generated, up to now this
  was hardcoded to gzip and would silently generate an erroneous image
  if another compressor was specified
- Document all the parameters
- Improve cross-building compatibility, by allowing passing either a
  string as before, or a function taking a package set and returning the
  path to a compressor in the "compressor" argument of the
  function.
- Support more compression algorithms
- Place compressor executable function and arguments in passthru, for
  reuse when appending initramfses

Co-Authored-By: Dominik Xaver Hörl <hoe.dom@gmx.de>
2020-12-17 11:37:04 +01:00
Linus Heckemann
3a3c9c9548 makeInitrd: include dotfiles at root 2020-12-17 11:10:37 +01:00
Linus Heckemann
85e0ae7827 makeInitrd: don't assume uImage => arm
mips for example might use uImages too
2020-12-17 11:10:37 +01:00
Eelco Dolstra
165b32d386
Revert "makeInitrd: Use closureInfo"
This reverts commit 776a5e6ebf.

Fixes #36268.
2018-03-05 12:49:59 +01:00
Eelco Dolstra
776a5e6ebf
makeInitrd: Use closureInfo 2018-02-23 16:41:31 +01:00
Joachim Fasting
5a8147479e make-initrd: create reproducible initrds
To achieve reproducible results, `cpio` archive members are added in
sorted order and inodes renumbered.

The `cpio-clean.pl` script is made obsolete by setting mtimes via
`touch` & using `cpio --reproducible`.  Suggested by @dezgeg in
https://github.com/NixOS/nixpkgs/pull/21273#issuecomment-268116605.

Note that using `--reproducible` means that initial ramdisk creation now
requires at least `cpio` version 2.12 (released in 2015).
2016-12-20 14:00:04 +01:00
Nikolay Amiantov
9c431b77ff make-initrd: store all files with root as owner 2015-12-28 12:07:11 +03:00
William A. Kennington III
f2655e4fa0 makeInitrd: Support prepending other initrds 2015-03-25 14:14:46 -07:00
Alexander Kjeldaas
f67015cae4 Make initrd and the kernel builds repeatable. 2014-04-05 08:41:06 +02:00
Shea Levy
79c3f992b4 makeInitrd: Make the compressor configurable 2013-02-19 11:49:31 -05:00
Eelco Dolstra
8336d55993 * Be less verbose generating initrds.
svn path=/nixpkgs/trunk/; revision=34199
2012-05-21 20:47:57 +00:00
Eelco Dolstra
c556a6ea46 * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless
function, so obsolete it.

svn path=/nixpkgs/branches/stdenv-updates/; revision=31644
2012-01-18 20:16:00 +00:00
Lluís Batlle i Rossell
4b27d28701 Porting changes from stdenv-updates into this branch.
This comes from:
svn diff  ^/nixpkgs/trunk/@18255 ^/nixpkgs/branches/stdenv-updates/ > diff
patch -p0 < diff
and then adding into svn all files new from the patch.

trunk@18255 comes from the last time I updated stdenv-updates from trunk.


svn path=/nixpkgs/stdenv-updates2/; revision=18272
2009-11-08 00:32:12 +00:00
Eelco Dolstra
3ee0b9bb74 * makeInitrd, makeModulesClosure: moved from NixOS.
* Use sh from klibc in the initrd.

svn path=/nixpkgs/trunk/; revision=11154
2008-03-17 10:40:47 +00:00