From 79c3f992b4998631b47e26b6c2725af70cb94aaf Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 19 Feb 2013 11:49:31 -0500 Subject: [PATCH] makeInitrd: Make the compressor configurable --- pkgs/build-support/kernel/make-initrd.nix | 3 ++- pkgs/build-support/kernel/make-initrd.sh | 2 +- pkgs/top-level/all-packages.nix | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/kernel/make-initrd.nix b/pkgs/build-support/kernel/make-initrd.nix index 2c0ca37553df..38def9c59a69 100644 --- a/pkgs/build-support/kernel/make-initrd.nix +++ b/pkgs/build-support/kernel/make-initrd.nix @@ -12,7 +12,7 @@ # `contents = {object = ...; symlink = /init;}' is a typical # argument. -{stdenv, perl, cpio, contents, ubootChooser}: +{stdenv, perl, cpio, contents, ubootChooser, compressor}: let inputsFun = ubootName : [perl cpio] @@ -40,4 +40,5 @@ stdenv.mkDerivation { buildNativeInputs = inputsFun stdenv.cross.platform.uboot; makeUInitrd = makeUInitrdFun stdenv.cross.platform.uboot; }; + inherit compressor; } diff --git a/pkgs/build-support/kernel/make-initrd.sh b/pkgs/build-support/kernel/make-initrd.sh index b2c784635699..f6cadaf02819 100644 --- a/pkgs/build-support/kernel/make-initrd.sh +++ b/pkgs/build-support/kernel/make-initrd.sh @@ -36,7 +36,7 @@ storePaths=$(perl $pathsFromGraph closure-*) # Put the closure in a gzipped cpio archive. mkdir -p $out -(cd root && find * -print0 | cpio -o -H newc --null | gzip -9 > $out/initrd) +(cd root && find * -print0 | cpio -o -H newc --null | $compressor > $out/initrd) if [ -n "$makeUInitrd" ]; then mv $out/initrd $out/initrd.gz diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2beabc6a3272..adb4c65a4be7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -323,9 +323,10 @@ let inherit lib; }; - makeInitrd = {contents}: import ../build-support/kernel/make-initrd.nix { - inherit stdenv perl cpio contents ubootChooser; - }; + makeInitrd = {contents, compressor ? "gzip -9"}: + import ../build-support/kernel/make-initrd.nix { + inherit stdenv perl cpio contents ubootChooser compressor; + }; makeWrapper = makeSetupHook { } ../build-support/setup-hooks/make-wrapper.sh;