From 6ae45d46eda3d45d8118666fd57eac01ad48aad8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 17 Nov 2006 15:27:31 +0000 Subject: [PATCH] * Put Nixpkgs and the NixOS expressions on the installation CD (the installer needs them). svn path=/nixu/trunk/; revision=7065 --- test/boot-environment.nix | 14 +++++++------- test/boot-stage-2-init.sh | 1 + test/rescue-cd.nix | 36 +++++++++++++++++++++++++++++++++++- 3 files changed, 43 insertions(+), 8 deletions(-) diff --git a/test/boot-environment.nix b/test/boot-environment.nix index 2dc1445e9f9..59fe96634e6 100644 --- a/test/boot-environment.nix +++ b/test/boot-environment.nix @@ -100,15 +100,15 @@ rec { pkgs.less pkgs.nano pkgs.netcat -# pkgs.vim pkgs.nix - pkgs.strace - pkgs.sysvinit - pkgs.procps - pkgs.shadowutils - pkgs.sysklogd - pkgs.rsync pkgs.perl + pkgs.procps + pkgs.rsync + pkgs.shadowutils + pkgs.strace + pkgs.sysklogd + pkgs.sysvinit +# pkgs.vim nixosInstaller ]; diff --git a/test/boot-stage-2-init.sh b/test/boot-stage-2-init.sh index edf3e9c0dbf..164c19dcf2b 100644 --- a/test/boot-stage-2-init.sh +++ b/test/boot-stage-2-init.sh @@ -79,6 +79,7 @@ echo "syslog 514/udp" > /etc/services # required, even if we don't use it for i in /sys/bus/pci/devices/*/modalias; do echo "Trying to load a module for $(basename $(dirname $i))..." modprobe $(cat $i) + echo "" done diff --git a/test/rescue-cd.nix b/test/rescue-cd.nix index da9e4cd3f3b..d045a903ff9 100644 --- a/test/rescue-cd.nix +++ b/test/rescue-cd.nix @@ -24,7 +24,7 @@ rec { name = "mount-points"; builder = builtins.toFile "builder.sh" " source $stdenv/setup - mkdir $out + ensureDir $out cd $out mkdir proc sys tmp etc dev var mnt nix nix/var touch $out/${cdromLabel} @@ -32,6 +32,34 @@ rec { }; + # 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. + makeTarball = tarName: input: pkgs.stdenv.mkDerivation { + name = "tarball"; + inherit tarName input; + builder = builtins.toFile "builder.sh" " + source $stdenv/setup + ensureDir $out + (cd $input && tar cvfj $out/$tarName . \\ + --exclude '*~' --exclude '.svn' \\ + --exclude 'pkgs' --exclude 'result') + "; + }; + + + # Put the current directory in the tarball. !!! This gives us a lot + # of crap (like .svn if this is a working copy). An "svn export" + # would be better, but that's impure. + nixosTarball = makeTarball "nixos.tar.bz2" ./.; + + + nixpkgsTarball = pkgs.fetchurl { + url = http://nix.cs.uu.nl/dist/nix/nixpkgs-0.11pre7060/nixpkgs-0.11pre7060.tar.bz2; + md5 = "67163e7a71f7b8cb01461e1d0467a6e1"; + }; + + # Create an ISO image containing the isolinux boot loader, the # kernel, the initrd produced above, and the closure of the stage 2 # init. @@ -55,6 +83,12 @@ rec { { source = cdMountPoints; target = "/"; } + { source = nixosTarball + "/" + nixosTarball.tarName; + target = "/" + nixosTarball.tarName; + } + { source = nixpkgsTarball; + target = "/nixpkgs.tar.bz2"; + } ]; init = bootStage2;