* Use the Perl version of paths-from-graphs everywhere.
svn path=/nixos/trunk/; revision=7774
This commit is contained in:
parent
903a64c87d
commit
d197a0f2cc
@ -12,12 +12,12 @@
|
|||||||
# `contents = {object = ...; symlink = /init;}' is a typical
|
# `contents = {object = ...; symlink = /init;}' is a typical
|
||||||
# argument.
|
# argument.
|
||||||
|
|
||||||
{stdenv, cpio, contents}:
|
{stdenv, perl, cpio, contents}:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "initrd";
|
name = "initrd";
|
||||||
builder = ./make-initrd.sh;
|
builder = ./make-initrd.sh;
|
||||||
buildInputs = [cpio];
|
buildInputs = [perl cpio];
|
||||||
|
|
||||||
# !!! should use XML.
|
# !!! should use XML.
|
||||||
objects = map (x: x.object) contents;
|
objects = map (x: x.object) contents;
|
||||||
@ -27,5 +27,5 @@ stdenv.mkDerivation {
|
|||||||
# For obtaining the closure of `contents'.
|
# For obtaining the closure of `contents'.
|
||||||
exportReferencesGraph =
|
exportReferencesGraph =
|
||||||
map (x: [("closure-" + baseNameOf x.symlink) x.object]) contents;
|
map (x: [("closure-" + baseNameOf x.symlink) x.object]) contents;
|
||||||
pathsFromGraph = ../helpers/paths-from-graph.sh;
|
pathsFromGraph = ../helpers/paths-from-graph.pl;
|
||||||
}
|
}
|
||||||
|
@ -20,23 +20,20 @@ for ((n = 0; n < ${#objects[*]}; n++)); do
|
|||||||
suffix=${suffices[$n]}
|
suffix=${suffices[$n]}
|
||||||
if test "$suffix" = none; then suffix=; fi
|
if test "$suffix" = none; then suffix=; fi
|
||||||
|
|
||||||
# Get the paths in the closure of `object'.
|
|
||||||
closure=closure-$(basename $symlink)
|
|
||||||
if ! test -e $closure; then
|
|
||||||
echo 'Your Nix installation is too old! Upgrade to nix-0.11pre7038 or newer.'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
storePaths=$($SHELL $pathsFromGraph $closure)
|
|
||||||
|
|
||||||
# Paths in cpio archives *must* be relative, otherwise the kernel
|
|
||||||
# won't unpack 'em.
|
|
||||||
(cd root && cp -prd --parents $storePaths .)
|
|
||||||
|
|
||||||
mkdir -p $(dirname root/$symlink)
|
mkdir -p $(dirname root/$symlink)
|
||||||
ln -s $object$suffix root/$symlink
|
ln -s $object$suffix root/$symlink
|
||||||
done
|
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 .)
|
||||||
|
|
||||||
|
|
||||||
# Put the closure in a gzipped cpio archive.
|
# Put the closure in a gzipped cpio archive.
|
||||||
ensureDir $out
|
ensureDir $out
|
||||||
(cd root && find * -print0 | cpio -ov -H newc --null | gzip -9 > $out/initrd)
|
(cd root && find * -print0 | cpio -ov -H newc --null | gzip -9 > $out/initrd)
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
graph="$1"
|
|
||||||
|
|
||||||
while read storePath; do
|
|
||||||
echo $storePath
|
|
||||||
read deriver
|
|
||||||
read count
|
|
||||||
for ((i = 0; i < $count; i++)); do
|
|
||||||
read ref
|
|
||||||
done
|
|
||||||
done < $graph
|
|
@ -86,7 +86,7 @@ rec {
|
|||||||
# The closure of the init script of boot stage 1 is what we put in
|
# The closure of the init script of boot stage 1 is what we put in
|
||||||
# the initial RAM disk.
|
# the initial RAM disk.
|
||||||
initialRamdisk = import ../boot/make-initrd.nix {
|
initialRamdisk = import ../boot/make-initrd.nix {
|
||||||
inherit (pkgs) stdenv cpio;
|
inherit (pkgs) perl stdenv cpio;
|
||||||
contents = [
|
contents = [
|
||||||
{ object = bootStage1;
|
{ object = bootStage1;
|
||||||
symlink = "/init";
|
symlink = "/init";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user