From ba43b5d00068fa93bfe340454f77c5deb3f0fcdd Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 9 Jun 2009 15:23:03 +0000 Subject: [PATCH] * Set the CD volume ID and the ISO filename. svn path=/nixos/branches/modular-nixos/; revision=15912 --- modules/installer/cd-dvd/installation-cd.nix | 20 ++++++++++- modules/installer/cd-dvd/iso-image.nix | 38 ++++++++++++++------ 2 files changed, 46 insertions(+), 12 deletions(-) diff --git a/modules/installer/cd-dvd/installation-cd.nix b/modules/installer/cd-dvd/installation-cd.nix index ca66a5b4728..68d2a76f93a 100644 --- a/modules/installer/cd-dvd/installation-cd.nix +++ b/modules/installer/cd-dvd/installation-cd.nix @@ -4,6 +4,18 @@ let + options = { + + system.nixosVersion = pkgs.lib.mkOption { + default = "${builtins.readFile ../../../VERSION}"; + description = '' + NixOS version number. + ''; + }; + + }; + + # We need a copy of the Nix expressions for Nixpkgs and NixOS on the # CD. We put them in a tarball because accessing that many small # files from a slow device like a CD-ROM takes too long. !!! Once @@ -25,11 +37,17 @@ in { require = - [ ./iso-image.nix + [ options + ./iso-image.nix ./memtest.nix ../../../hardware/network/intel-3945abg.nix ]; + # ISO naming. + isoImage.isoName = "nixos-${config.system.nixosVersion}-${pkgs.stdenv.system}.iso"; + + isoImage.volumeID = "NIXOS_INSTALLATION_CD_${config.system.nixosVersion}"; + # Use Linux 2.6.29. boot.kernelPackages = pkgs.kernelPackages_2_6_29; diff --git a/modules/installer/cd-dvd/iso-image.nix b/modules/installer/cd-dvd/iso-image.nix index 65abf4c18c4..d17106cde32 100644 --- a/modules/installer/cd-dvd/iso-image.nix +++ b/modules/installer/cd-dvd/iso-image.nix @@ -8,6 +8,30 @@ let options = { + isoImage.isoName = pkgs.lib.mkOption { + default = "cd.iso"; + description = '' + Name of the generated ISO image file. + ''; + }; + + isoImage.compressImage = pkgs.lib.mkOption { + default = false; + description = '' + Whether the ISO image should be compressed using + bzip2. + ''; + }; + + isoImage.volumeID = pkgs.lib.mkOption { + default = "NIXOS_BOOT_CD"; + description = '' + Specifies the label or volume ID of the generated ISO image. + Note that the label is used by stage 1 of the boot process to + mount the CD, so it should be reasonably distinctive. + ''; + }; + isoImage.contents = pkgs.lib.mkOption { example = [ { source = pkgs.memtest86 + "/memtest.bin"; @@ -34,8 +58,6 @@ let }; - - cdLabel = "NIXOS_INSTALLATION_CD"; # The configuration file for Grub. grubCfg = @@ -56,7 +78,7 @@ in # so that we don't need to know its device. fileSystems = [ { mountPoint = "/"; - label = cdLabel; + label = config.isoImage.volumeID; } ]; @@ -115,17 +137,11 @@ in # Create the ISO image. system.build.isoImage = import ../../../lib/make-iso9660-image.nix { inherit (pkgs) stdenv perl cdrkit pathsFromGraph; - #isoName = "${relName}-${platform}.iso"; + + inherit (config.isoImage) isoName compressImage volumeID contents storeContents; bootable = true; bootImage = "/boot/grub/stage2_eltorito"; - - #compressImage = ...; - - volumeID = cdLabel; - - contents = config.isoImage.contents; - storeContents = config.isoImage.storeContents; }; # After booting, register the contents of the Nix store on the CD in