forked from mirrors/nixpkgs
make-initrd-ng: clean up a bit
This commit is contained in:
parent
ee38010981
commit
de93795b46
|
@ -8,7 +8,7 @@ let
|
||||||
# compression type and filename extension.
|
# compression type and filename extension.
|
||||||
compressorName = fullCommand: builtins.elemAt (builtins.match "([^ ]*/)?([^ ]+).*" fullCommand) 1;
|
compressorName = fullCommand: builtins.elemAt (builtins.match "([^ ]*/)?([^ ]+).*" fullCommand) 1;
|
||||||
in
|
in
|
||||||
{ stdenvNoCC, perl, cpio, ubootTools, lib, pkgsBuildHost, makeInitrdNGTool, patchelf, binutils, runCommand
|
{ stdenvNoCC, perl, cpio, ubootTools, lib, pkgsBuildHost, makeInitrdNGTool, binutils, runCommand
|
||||||
# Name of the derivation (not of the resulting file!)
|
# Name of the derivation (not of the resulting file!)
|
||||||
, name ? "initrd"
|
, name ? "initrd"
|
||||||
|
|
||||||
|
@ -74,10 +74,9 @@ in
|
||||||
passAsFile = ["contents"];
|
passAsFile = ["contents"];
|
||||||
contents = lib.concatMapStringsSep "\n" ({ object, symlink, ... }: "${object}\n${if symlink == null then "" else symlink}") contents + "\n";
|
contents = lib.concatMapStringsSep "\n" ({ object, symlink, ... }: "${object}\n${if symlink == null then "" else symlink}") contents + "\n";
|
||||||
|
|
||||||
nativeBuildInputs = [makeInitrdNGTool patchelf cpio] ++ lib.optional makeUInitrd ubootTools ++ lib.optional strip binutils;
|
nativeBuildInputs = [makeInitrdNGTool cpio] ++ lib.optional makeUInitrd ubootTools ++ lib.optional strip binutils;
|
||||||
|
|
||||||
} // lib.optionalAttrs strip {
|
STRIP = if strip then "${(binutils.nativeDrv or binutils).targetPrefix}strip" else null;
|
||||||
STRIP = "${(binutils.nativeDrv or binutils).targetPrefix}strip";
|
|
||||||
}) ''
|
}) ''
|
||||||
mkdir ./root
|
mkdir ./root
|
||||||
make-initrd-ng "$contentsPath" ./root
|
make-initrd-ng "$contentsPath" ./root
|
||||||
|
|
Loading…
Reference in a new issue