Skip to content

Commit

Permalink
Revert "makeInitrd: Use closureInfo"
Browse files Browse the repository at this point in the history
This reverts commit 776a5e6.

Fixes #36268.
  • Loading branch information
edolstra committed Mar 5, 2018
1 parent 9769391 commit 165b32d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 6 additions & 3 deletions pkgs/build-support/kernel/make-initrd.nix
Expand Up @@ -12,7 +12,7 @@
# `contents = {object = ...; symlink = /init;}' is a typical
# argument.

{ stdenv, closureInfo, cpio, contents, compressor, prepend, ubootTools
{ stdenv, perl, cpio, contents, compressor, prepend, ubootTools
, hostPlatform
}:

Expand All @@ -22,15 +22,18 @@ stdenv.mkDerivation rec {

makeUInitrd = hostPlatform.platform.kernelTarget == "uImage";

nativeBuildInputs = [ cpio ]
nativeBuildInputs = [ perl cpio ]
++ stdenv.lib.optional makeUInitrd ubootTools;

# !!! should use XML.
objects = map (x: x.object) contents;
symlinks = map (x: x.symlink) contents;
suffices = map (x: if x ? suffix then x.suffix else "none") contents;

closure = closureInfo { rootPaths = (map (x: x.object) contents); };
# For obtaining the closure of `contents'.
exportReferencesGraph =
map (x: [("closure-" + baseNameOf x.symlink) x.object]) contents;
pathsFromGraph = ./paths-from-graph.pl;

inherit compressor prepend;
}
6 changes: 5 additions & 1 deletion pkgs/build-support/kernel/make-initrd.sh
Expand Up @@ -25,9 +25,13 @@ 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 $(cat $closure/store-paths) .)
(cd root && cp -prd --parents $storePaths .)


# Put the closure in a gzipped cpio archive.
Expand Down

0 comments on commit 165b32d

Please sign in to comment.