3
0
Fork 0
forked from mirrors/nixpkgs

* Allow compression of ISO images.

svn path=/nixos/trunk/; revision=11987
This commit is contained in:
Eelco Dolstra 2008-06-05 13:42:18 +00:00
parent df241fd6ed
commit e7494da962
3 changed files with 15 additions and 4 deletions

View file

@ -3,6 +3,7 @@
if builtins.pathExists ../relname
then builtins.readFile ../relname
else "nixos-${builtins.readFile ../VERSION}"
, compressImage ? false
}:
rec {
@ -304,6 +305,8 @@ rec {
bootable = true;
bootImage = "boot/grub/stage2_eltorito";
inherit compressImage;
};

View file

@ -25,6 +25,9 @@
# The path (in the ISO file system) of the boot image.
, bootImage ? ""
, # Whether to compress the resulting ISO image with bzip2.
compressImage ? false
}:
assert bootable -> bootImage != "";
@ -33,7 +36,7 @@ stdenv.mkDerivation {
name = "iso9660-image";
builder = ./make-iso9660-image.sh;
buildInputs = [perl cdrkit];
inherit isoName bootable bootImage;
inherit isoName bootable bootImage compressImage;
# !!! should use XML.
sources = map (x: x.source) contents;

View file

@ -59,10 +59,15 @@ done
cat pathlist | sed -e 's/=\(.*\)=\(.*\)=/\\=\1=\2\\=/' | tee pathlist.safer
# !!! -f is a quick hack.
ensureDir $out/iso
genisoimage -r -J -o $out/iso/$isoName $bootFlags \
-hide-rr-moved -graft-points -path-list pathlist.safer
genCommand="genisoimage -r -J $bootFlags -hide-rr-moved -graft-points -path-list pathlist.safer"
if test -z "$compressImage"; then
$genCommand -o $out/iso/$isoName
else
$genCommand | bzip2 > $out/iso/$isoName.bz2
fi
ensureDir $out/nix-support
echo $system > $out/nix-support/system