* Doh! Make sure that we put *only* splash_helper in the initrd and

not all of splashutils, otherwise we get Glibc in the initrd.

svn path=/nixos/trunk/; revision=7771
This commit is contained in:
Eelco Dolstra
2007-01-23 13:44:41 +00:00
parent a7d81141be
commit 668c146e33
6 changed files with 62 additions and 28 deletions

View File

@@ -9,16 +9,12 @@
# grafted in the file system at path `target'.
contents
/*
, # In addition to `contents', the closure of the store paths listed
# in `packages' are also placed in the file system.
packages ? []
*/
, # `init' should be a store path, the closure of which is added to
# the image, just like `packages'. However, in addition, a symlink
# `/init' to `init' will be created.
init ? null
# in `packages' are also placed in the Nix store of the CD. This is
# a list of attribute sets {source, target} where `source' if a
# store path whose closure will be copied, and `target' is a symlink
# to `source' that will be added to the CD.
storeContents ? []
# Whether this should be an El-Torito bootable CD.
, bootable ? false
@@ -34,11 +30,18 @@ stdenv.mkDerivation {
name = "iso9660-image";
builder = ./make-iso9660-image.sh;
buildInputs = [cdrtools];
inherit isoName init bootable bootImage;
sources = map ({source, target}: source) contents;
targets = map ({source, target}: target) contents;
inherit isoName bootable bootImage;
# For obtaining the closure of `init'.
exportReferencesGraph = ["init-closure" init];
# !!! should use XML.
sources = map (x: x.source) contents;
targets = map (x: x.target) contents;
# !!! should use XML.
objects = map (x: x.object) storeContents;
symlinks = map (x: x.symlink) storeContents;
# For obtaining the closure of `storeContents'.
exportReferencesGraph =
map (x: [("closure-" + baseNameOf x.symlink) x.object]) storeContents;
pathsFromGraph = ./paths-from-graph.sh;
}

View File

@@ -1,26 +1,46 @@
source $stdenv/setup
sources_=($sources)
targets_=($targets)
objects=($objects)
symlinks=($symlinks)
if test -n "$bootable"; then
bootFlags="-b $bootImage -c boot.cat -no-emul-boot -boot-load-size 4"
fi
graftList=
sources_=($sources)
targets_=($targets)
for ((i = 0; i < ${#targets_[@]}; i++)); do
graftList="$graftList ${targets_[$i]}=$(readlink -f ${sources_[$i]})"
done
storePaths=$($SHELL $pathsFromGraph ./init-closure)
for i in $storePaths; do
graftList="$graftList ${i:1}=$i"
for ((n = 0; n < ${#objects[*]}; n++)); do
object=${objects[$n]}
symlink=${symlinks[$n]}
# 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)
for i in $storePaths; do
graftList="$graftList ${i:1}=$i"
done
if test "$symlink" != "none"; then
mkdir -p $(dirname ./$symlink)
ln -s $object ./$symlink
graftList="$graftList $symlink=./$symlink"
fi
done
if test -n "$init"; then
ln -s $init init
graftList="$graftList init=init"
fi
# !!! -f is a quick hack.
ensureDir $out/iso