2006-11-02 18:56:50 +01:00
|
|
|
source $stdenv/setup
|
|
|
|
|
2007-01-23 14:44:41 +01:00
|
|
|
sources_=($sources)
|
|
|
|
targets_=($targets)
|
|
|
|
|
|
|
|
objects=($objects)
|
|
|
|
symlinks=($symlinks)
|
|
|
|
|
2006-11-02 18:56:50 +01:00
|
|
|
if test -n "$bootable"; then
|
2007-02-07 16:23:19 +01:00
|
|
|
|
|
|
|
# The -boot-info-table option modifies the $bootImage file, so
|
|
|
|
# find it in `contents' and make a copy of it (since the original
|
|
|
|
# is read-only in the Nix store...).
|
|
|
|
for ((i = 0; i < ${#targets_[@]}; i++)); do
|
|
|
|
if test "${targets_[$i]}" = "$bootImage"; then
|
|
|
|
echo "copying the boot image ${sources_[$i]}"
|
|
|
|
cp "${sources_[$i]}" boot.img
|
|
|
|
chmod u+w boot.img
|
|
|
|
sources_[$i]=boot.img
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2008-01-24 17:56:09 +01:00
|
|
|
bootFlags="-b $bootImage -c .boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table"
|
2006-11-02 18:56:50 +01:00
|
|
|
fi
|
|
|
|
|
2008-01-15 16:39:34 +01:00
|
|
|
touch pathlist
|
2007-01-23 14:44:41 +01:00
|
|
|
|
2007-01-23 15:34:44 +01:00
|
|
|
# Add the individual files.
|
2006-11-04 00:41:57 +01:00
|
|
|
for ((i = 0; i < ${#targets_[@]}; i++)); do
|
2008-01-15 16:39:34 +01:00
|
|
|
echo "${targets_[$i]}=$(readlink -f ${sources_[$i]})" >> pathlist
|
2006-11-04 00:41:57 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
|
2007-01-23 15:34:44 +01:00
|
|
|
# Add the closures of the top-level store objects.
|
|
|
|
storePaths=$(perl $pathsFromGraph closure-*)
|
|
|
|
for i in $storePaths; do
|
2008-01-15 16:39:34 +01:00
|
|
|
echo "${i:1}=$i" >> pathlist
|
2007-01-23 15:34:44 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
|
2007-01-23 16:08:00 +01:00
|
|
|
# Also put a nix-pull manifest of the closures on the CD.
|
|
|
|
printManifest=1 perl $pathsFromGraph closure-* > MANIFEST
|
2008-01-15 16:39:34 +01:00
|
|
|
echo "MANIFEST=MANIFEST" >> pathlist
|
2007-01-23 16:08:00 +01:00
|
|
|
|
|
|
|
|
2007-01-23 15:34:44 +01:00
|
|
|
# Add symlinks to the top-level store objects.
|
2007-01-23 14:44:41 +01:00
|
|
|
for ((n = 0; n < ${#objects[*]}; n++)); do
|
|
|
|
object=${objects[$n]}
|
|
|
|
symlink=${symlinks[$n]}
|
|
|
|
if test "$symlink" != "none"; then
|
|
|
|
mkdir -p $(dirname ./$symlink)
|
|
|
|
ln -s $object ./$symlink
|
2008-01-15 16:39:34 +01:00
|
|
|
echo "$symlink=./$symlink" >> pathlist
|
2007-01-23 14:44:41 +01:00
|
|
|
fi
|
2006-11-04 00:41:57 +01:00
|
|
|
done
|
|
|
|
|
2008-01-15 16:39:34 +01:00
|
|
|
cat pathlist
|
|
|
|
|
2006-11-02 18:56:50 +01:00
|
|
|
# !!! -f is a quick hack.
|
2006-11-04 13:08:10 +01:00
|
|
|
ensureDir $out/iso
|
2008-01-04 16:17:54 +01:00
|
|
|
genisoimage -r -J -o $out/iso/$isoName $bootFlags \
|
2008-01-24 17:56:09 +01:00
|
|
|
-hide-rr-moved -graft-points -path-list pathlist
|
2006-11-04 13:00:05 +01:00
|
|
|
|
|
|
|
ensureDir $out/nix-support
|
|
|
|
echo $system > $out/nix-support/system
|