summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmily <vcs@emily.moe>2024-10-31 15:39:15 +0000
committerGitHub <noreply@github.com>2024-10-31 15:39:15 +0000
commit75f91d160a365c2645a2a7f22a6dc3951eb2f3d5 (patch)
treeb0aa8a773afb9c23050c1eab75f9f1cdd2c9db0b
parent[Backport staging-24.05] mpg123: 1.32.7 -> 1.32.8 (#352437) (diff)
parenttree-wide: switch initrd generators back to gnu cpio (diff)
downloadnixpkgs-75f91d160a365c2645a2a7f22a6dc3951eb2f3d5.tar.gz
[Backport staging-24.05] [staging-next] tree-wide: switch initrd generators back to gnu cpio (#352634)
-rw-r--r--nixos/modules/system/boot/stage-1.nix4
-rw-r--r--pkgs/build-support/kernel/make-initrd-ng.nix6
-rw-r--r--pkgs/build-support/kernel/make-initrd.nix4
-rw-r--r--pkgs/build-support/kernel/make-initrd.sh2
4 files changed, 8 insertions, 8 deletions
diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix
index ae05bc5ae88c..0a719287701e 100644
--- a/nixos/modules/system/boot/stage-1.nix
+++ b/nixos/modules/system/boot/stage-1.nix
@@ -410,7 +410,7 @@ let
${lib.optionalString (config.boot.initrd.secrets == {})
"exit 0"}
- export PATH=${pkgs.coreutils}/bin:${pkgs.libarchive}/bin:${pkgs.gzip}/bin:${pkgs.findutils}/bin
+ export PATH=${pkgs.coreutils}/bin:${pkgs.cpio}/bin:${pkgs.gzip}/bin:${pkgs.findutils}/bin
function cleanup {
if [ -n "$tmp" -a -d "$tmp" ]; then
@@ -431,7 +431,7 @@ let
}
# mindepth 1 so that we don't change the mode of /
- (cd "$tmp" && find . -mindepth 1 | xargs touch -amt 197001010000 && find . -mindepth 1 -print0 | sort -z | bsdtar --uid 0 --gid 0 -cnf - -T - | bsdtar --null -cf - --format=newc @-) | \
+ (cd "$tmp" && find . -mindepth 1 | xargs touch -amt 197001010000 && find . -mindepth 1 -print0 | sort -z | cpio --quiet -o -H newc -R +0:+0 --reproducible --null) | \
${compressorExe} ${lib.escapeShellArgs initialRamdisk.compressorArgs} >> "$1"
'';
diff --git a/pkgs/build-support/kernel/make-initrd-ng.nix b/pkgs/build-support/kernel/make-initrd-ng.nix
index 65e143cb7349..e891ce292f47 100644
--- a/pkgs/build-support/kernel/make-initrd-ng.nix
+++ b/pkgs/build-support/kernel/make-initrd-ng.nix
@@ -8,7 +8,7 @@ let
# compression type and filename extension.
compressorName = fullCommand: builtins.elemAt (builtins.match "([^ ]*/)?([^ ]+).*" fullCommand) 1;
in
-{ stdenvNoCC, libarchive, ubootTools, lib, pkgsBuildHost, makeInitrdNGTool, binutils, runCommand
+{ stdenvNoCC, cpio, ubootTools, lib, pkgsBuildHost, makeInitrdNGTool, binutils, runCommand
# Name of the derivation (not of the resulting file!)
, name ? "initrd"
@@ -74,7 +74,7 @@ in
passAsFile = ["contents"];
contents = lib.concatMapStringsSep "\n" ({ object, symlink, ... }: "${object}\n${lib.optionalString (symlink != null) symlink}") contents + "\n";
- nativeBuildInputs = [makeInitrdNGTool libarchive] ++ lib.optional makeUInitrd ubootTools ++ lib.optional strip binutils;
+ nativeBuildInputs = [makeInitrdNGTool cpio] ++ lib.optional makeUInitrd ubootTools ++ lib.optional strip binutils;
STRIP = if strip then "${pkgsBuildHost.binutils.targetPrefix}strip" else null;
}) ''
@@ -85,7 +85,7 @@ in
for PREP in $prepend; do
cat $PREP >> $out/initrd
done
- (cd root && find . -print0 | sort -z | bsdtar --uid 0 --gid 0 -cnf - -T - | bsdtar --null -cf - --format=newc @- | eval -- $compress >> "$out/initrd")
+ (cd root && find . -print0 | sort -z | cpio --quiet -o -H newc -R +0:+0 --reproducible --null | eval -- $compress >> "$out/initrd")
if [ -n "$makeUInitrd" ]; then
mkimage -A "$uInitrdArch" -O linux -T ramdisk -C "$uInitrdCompression" -d "$out/initrd" $out/initrd.img
diff --git a/pkgs/build-support/kernel/make-initrd.nix b/pkgs/build-support/kernel/make-initrd.nix
index 9c27a142f4b6..23ce992f0d55 100644
--- a/pkgs/build-support/kernel/make-initrd.nix
+++ b/pkgs/build-support/kernel/make-initrd.nix
@@ -18,7 +18,7 @@ let
# compression type and filename extension.
compressorName = fullCommand: builtins.elemAt (builtins.match "([^ ]*/)?([^ ]+).*" fullCommand) 1;
in
-{ stdenvNoCC, perl, libarchive, ubootTools, lib, pkgsBuildHost
+{ stdenvNoCC, perl, cpio, ubootTools, lib, pkgsBuildHost
# Name of the derivation (not of the resulting file!)
, name ? "initrd"
@@ -82,7 +82,7 @@ in stdenvNoCC.mkDerivation rec {
builder = ./make-initrd.sh;
- nativeBuildInputs = [ perl libarchive ]
+ nativeBuildInputs = [ perl cpio ]
++ lib.optional makeUInitrd ubootTools;
compress = "${_compressorExecutable} ${lib.escapeShellArgs _compressorArgsReal}";
diff --git a/pkgs/build-support/kernel/make-initrd.sh b/pkgs/build-support/kernel/make-initrd.sh
index 8f64114d54c3..0149c5d487ac 100644
--- a/pkgs/build-support/kernel/make-initrd.sh
+++ b/pkgs/build-support/kernel/make-initrd.sh
@@ -40,7 +40,7 @@ for PREP in $prepend; do
cat $PREP >> $out/initrd
done
(cd root && find * .[^.*] -exec touch -h -d '@1' '{}' +)
-(cd root && find * .[^.*] -print0 | sort -z | bsdtar --uid 0 --gid 0 -cnf - -T - | bsdtar --null -cf - --format=newc @- | eval -- $compress >> "$out/initrd")
+(cd root && find * .[^.*] -print0 | sort -z | cpio --quiet -o -H newc -R +0:+0 --reproducible --null | eval -- $compress >> "$out/initrd")
if [ -n "$makeUInitrd" ]; then
mkimage -A "$uInitrdArch" -O linux -T ramdisk -C "$uInitrdCompression" -d "$out/initrd" $out/initrd.img