mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-20 20:20:26 +03:00
makeInitrd: Use closureInfo
This commit is contained in:
parent
d12c9911df
commit
776a5e6ebf
@ -4,7 +4,7 @@
|
|||||||
# "nix-store --load-db" and "nix-store --register-validity
|
# "nix-store --load-db" and "nix-store --register-validity
|
||||||
# --hash-given".
|
# --hash-given".
|
||||||
|
|
||||||
{ stdenv, coreutils, jq, perl, pathsFromGraph }:
|
{ stdenv, coreutils, jq }:
|
||||||
|
|
||||||
{ rootPaths }:
|
{ rootPaths }:
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# `contents = {object = ...; symlink = /init;}' is a typical
|
# `contents = {object = ...; symlink = /init;}' is a typical
|
||||||
# argument.
|
# argument.
|
||||||
|
|
||||||
{ stdenv, perl, cpio, contents, compressor, prepend, ubootTools
|
{ stdenv, closureInfo, cpio, contents, compressor, prepend, ubootTools
|
||||||
, hostPlatform
|
, hostPlatform
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
makeUInitrd = hostPlatform.platform.kernelTarget == "uImage";
|
makeUInitrd = hostPlatform.platform.kernelTarget == "uImage";
|
||||||
|
|
||||||
nativeBuildInputs = [ perl cpio ]
|
nativeBuildInputs = [ cpio ]
|
||||||
++ stdenv.lib.optional makeUInitrd ubootTools;
|
++ stdenv.lib.optional makeUInitrd ubootTools;
|
||||||
|
|
||||||
# !!! should use XML.
|
# !!! should use XML.
|
||||||
@ -30,10 +30,7 @@ stdenv.mkDerivation rec {
|
|||||||
symlinks = map (x: x.symlink) contents;
|
symlinks = map (x: x.symlink) contents;
|
||||||
suffices = map (x: if x ? suffix then x.suffix else "none") contents;
|
suffices = map (x: if x ? suffix then x.suffix else "none") contents;
|
||||||
|
|
||||||
# For obtaining the closure of `contents'.
|
closure = closureInfo { rootPaths = (map (x: x.object) contents); };
|
||||||
exportReferencesGraph =
|
|
||||||
map (x: [("closure-" + baseNameOf x.symlink) x.object]) contents;
|
|
||||||
pathsFromGraph = ./paths-from-graph.pl;
|
|
||||||
|
|
||||||
inherit compressor prepend;
|
inherit compressor prepend;
|
||||||
}
|
}
|
||||||
|
@ -25,13 +25,9 @@ for ((n = 0; n < ${#objects[*]}; n++)); do
|
|||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
# Get the paths in the closure of `object'.
|
|
||||||
storePaths=$(perl $pathsFromGraph closure-*)
|
|
||||||
|
|
||||||
|
|
||||||
# Paths in cpio archives *must* be relative, otherwise the kernel
|
# Paths in cpio archives *must* be relative, otherwise the kernel
|
||||||
# won't unpack 'em.
|
# 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.
|
# Put the closure in a gzipped cpio archive.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# NOTE: this script is deprecated. Use closureInfo instead.
|
||||||
|
|
||||||
# Parses a /nix/store/*-closure file and prints
|
# Parses a /nix/store/*-closure file and prints
|
||||||
# various information.
|
# various information.
|
||||||
# By default, the nodes in the graph are printed to stdout.
|
# By default, the nodes in the graph are printed to stdout.
|
||||||
|
Loading…
Reference in New Issue
Block a user