makeInitrd: Use closureInfo

Changed files
+7 -12
pkgs
+1 -1
pkgs/build-support/closure-info.nix
···
# "nix-store --load-db" and "nix-store --register-validity
# --hash-given".
-
{ stdenv, coreutils, jq, perl, pathsFromGraph }:
+
{ stdenv, coreutils, jq }:
{ rootPaths }:
+3 -6
pkgs/build-support/kernel/make-initrd.nix
···
# `contents = {object = ...; symlink = /init;}' is a typical
# argument.
-
{ stdenv, perl, cpio, contents, compressor, prepend, ubootTools
+
{ stdenv, closureInfo, cpio, contents, compressor, prepend, ubootTools
, hostPlatform
}:
···
makeUInitrd = hostPlatform.platform.kernelTarget == "uImage";
-
nativeBuildInputs = [ perl cpio ]
+
nativeBuildInputs = [ cpio ]
++ stdenv.lib.optional makeUInitrd ubootTools;
# !!! should use XML.
···
symlinks = map (x: x.symlink) contents;
suffices = map (x: if x ? suffix then x.suffix else "none") contents;
-
# For obtaining the closure of `contents'.
-
exportReferencesGraph =
-
map (x: [("closure-" + baseNameOf x.symlink) x.object]) contents;
-
pathsFromGraph = ./paths-from-graph.pl;
+
closure = closureInfo { rootPaths = (map (x: x.object) contents); };
inherit compressor prepend;
}
+1 -5
pkgs/build-support/kernel/make-initrd.sh
···
done
-
# Get the paths in the closure of `object'.
-
storePaths=$(perl $pathsFromGraph closure-*)
-
-
# Paths in cpio archives *must* be relative, otherwise the kernel
# won't unpack 'em.
-
(cd root && cp -prd --parents $storePaths .)
+
(cd root && cp -prd --parents $(cat $closure/store-paths) .)
# Put the closure in a gzipped cpio archive.
+2
pkgs/build-support/kernel/paths-from-graph.pl
···
+
# NOTE: this script is deprecated. Use closureInfo instead.
+
# Parses a /nix/store/*-closure file and prints
# various information.
# By default, the nodes in the graph are printed to stdout.