* Allow compression of ISO images.
svn path=/nixos/trunk/; revision=11987
This commit is contained in:
parent
df241fd6ed
commit
e7494da962
|
@ -3,6 +3,7 @@
|
||||||
if builtins.pathExists ../relname
|
if builtins.pathExists ../relname
|
||||||
then builtins.readFile ../relname
|
then builtins.readFile ../relname
|
||||||
else "nixos-${builtins.readFile ../VERSION}"
|
else "nixos-${builtins.readFile ../VERSION}"
|
||||||
|
, compressImage ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
|
@ -304,6 +305,8 @@ rec {
|
||||||
|
|
||||||
bootable = true;
|
bootable = true;
|
||||||
bootImage = "boot/grub/stage2_eltorito";
|
bootImage = "boot/grub/stage2_eltorito";
|
||||||
|
|
||||||
|
inherit compressImage;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,9 @@
|
||||||
# The path (in the ISO file system) of the boot image.
|
# The path (in the ISO file system) of the boot image.
|
||||||
, bootImage ? ""
|
, bootImage ? ""
|
||||||
|
|
||||||
|
, # Whether to compress the resulting ISO image with bzip2.
|
||||||
|
compressImage ? false
|
||||||
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert bootable -> bootImage != "";
|
assert bootable -> bootImage != "";
|
||||||
|
@ -33,7 +36,7 @@ stdenv.mkDerivation {
|
||||||
name = "iso9660-image";
|
name = "iso9660-image";
|
||||||
builder = ./make-iso9660-image.sh;
|
builder = ./make-iso9660-image.sh;
|
||||||
buildInputs = [perl cdrkit];
|
buildInputs = [perl cdrkit];
|
||||||
inherit isoName bootable bootImage;
|
inherit isoName bootable bootImage compressImage;
|
||||||
|
|
||||||
# !!! should use XML.
|
# !!! should use XML.
|
||||||
sources = map (x: x.source) contents;
|
sources = map (x: x.source) contents;
|
||||||
|
|
|
@ -59,10 +59,15 @@ done
|
||||||
|
|
||||||
cat pathlist | sed -e 's/=\(.*\)=\(.*\)=/\\=\1=\2\\=/' | tee pathlist.safer
|
cat pathlist | sed -e 's/=\(.*\)=\(.*\)=/\\=\1=\2\\=/' | tee pathlist.safer
|
||||||
|
|
||||||
# !!! -f is a quick hack.
|
|
||||||
ensureDir $out/iso
|
ensureDir $out/iso
|
||||||
genisoimage -r -J -o $out/iso/$isoName $bootFlags \
|
genCommand="genisoimage -r -J $bootFlags -hide-rr-moved -graft-points -path-list pathlist.safer"
|
||||||
-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
|
ensureDir $out/nix-support
|
||||||
echo $system > $out/nix-support/system
|
echo $system > $out/nix-support/system
|
||||||
|
|
Loading…
Reference in a new issue