summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-02-08 13:56:54 +0100
committerEelco Dolstra <edolstra@gmail.com>2018-02-23 16:41:31 +0100
commit776a5e6ebfacc6831527bc6c3c1a58ef2087c819 (patch)
tree0b877d6a5b4c80759178a1332613476b2a86a010 /pkgs/build-support
parentd12c9911dfcb336243c9d13b8bc7042be3f3d4b2 (diff)
downloadnixpkgs-776a5e6ebfacc6831527bc6c3c1a58ef2087c819.tar
nixpkgs-776a5e6ebfacc6831527bc6c3c1a58ef2087c819.tar.gz
nixpkgs-776a5e6ebfacc6831527bc6c3c1a58ef2087c819.tar.bz2
nixpkgs-776a5e6ebfacc6831527bc6c3c1a58ef2087c819.tar.lz
nixpkgs-776a5e6ebfacc6831527bc6c3c1a58ef2087c819.tar.xz
nixpkgs-776a5e6ebfacc6831527bc6c3c1a58ef2087c819.tar.zst
nixpkgs-776a5e6ebfacc6831527bc6c3c1a58ef2087c819.zip
makeInitrd: Use closureInfo
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/closure-info.nix2
-rw-r--r--pkgs/build-support/kernel/make-initrd.nix9
-rw-r--r--pkgs/build-support/kernel/make-initrd.sh6
-rw-r--r--pkgs/build-support/kernel/paths-from-graph.pl2
4 files changed, 7 insertions, 12 deletions
diff --git a/pkgs/build-support/closure-info.nix b/pkgs/build-support/closure-info.nix
index 54b1fe59b66..25978e974cf 100644
--- a/pkgs/build-support/closure-info.nix
+++ b/pkgs/build-support/closure-info.nix
@@ -4,7 +4,7 @@
 # "nix-store --load-db" and "nix-store --register-validity
 # --hash-given".
 
-{ stdenv, coreutils, jq, perl, pathsFromGraph }:
+{ stdenv, coreutils, jq }:
 
 { rootPaths }:
 
diff --git a/pkgs/build-support/kernel/make-initrd.nix b/pkgs/build-support/kernel/make-initrd.nix
index 5353ae82841..a4d162dc8b5 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, compressor, prepend, ubootTools
+{ stdenv, closureInfo, cpio, contents, compressor, prepend, ubootTools
 , hostPlatform
 }:
 
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   makeUInitrd = hostPlatform.platform.kernelTarget == "uImage";
 
-  nativeBuildInputs = [ perl cpio ]
+  nativeBuildInputs = [ cpio ]
     ++ stdenv.lib.optional makeUInitrd ubootTools;
 
   # !!! should use XML.
@@ -30,10 +30,7 @@ stdenv.mkDerivation rec {
   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;
 }
diff --git a/pkgs/build-support/kernel/make-initrd.sh b/pkgs/build-support/kernel/make-initrd.sh
index 0aeaedeb372..2e64eeb81c1 100644
--- a/pkgs/build-support/kernel/make-initrd.sh
+++ b/pkgs/build-support/kernel/make-initrd.sh
@@ -25,13 +25,9 @@ for ((n = 0; n < ${#objects[*]}; n++)); do
 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.
diff --git a/pkgs/build-support/kernel/paths-from-graph.pl b/pkgs/build-support/kernel/paths-from-graph.pl
index 747e1edec81..1465b73fddb 100644
--- a/pkgs/build-support/kernel/paths-from-graph.pl
+++ b/pkgs/build-support/kernel/paths-from-graph.pl
@@ -1,3 +1,5 @@
+# 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.