summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2010-08-29 22:09:15 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2010-08-29 22:09:15 +0000
commita242602b40284e16f748372b25f9d4e9b1df26e2 (patch)
tree4747e4bfe19d7a78befad6cca4bc07a98fd8bafe
parent4963f769d91461e250a720c8ba89d3571b91b8c1 (diff)
downloadnixpkgs-a242602b40284e16f748372b25f9d4e9b1df26e2.tar
nixpkgs-a242602b40284e16f748372b25f9d4e9b1df26e2.tar.gz
nixpkgs-a242602b40284e16f748372b25f9d4e9b1df26e2.tar.bz2
nixpkgs-a242602b40284e16f748372b25f9d4e9b1df26e2.tar.lz
nixpkgs-a242602b40284e16f748372b25f9d4e9b1df26e2.tar.xz
nixpkgs-a242602b40284e16f748372b25f9d4e9b1df26e2.tar.zst
nixpkgs-a242602b40284e16f748372b25f9d4e9b1df26e2.zip
* /data -> /ephemeral0.
* Put /tmp and /var on the /ephemeral0, as it has much more
  space than the root filesystem.
* Panic on stage 1 errors since they cannot be repaired anyway.

svn path=/nixos/trunk/; revision=23532
-rw-r--r--modules/virtualisation/amazon-image.nix20
1 files changed, 18 insertions, 2 deletions
diff --git a/modules/virtualisation/amazon-image.nix b/modules/virtualisation/amazon-image.nix
index a81f40cc759..ac31f67cf1a 100644
--- a/modules/virtualisation/amazon-image.nix
+++ b/modules/virtualisation/amazon-image.nix
@@ -59,9 +59,9 @@ with pkgs.lib;
     [ { mountPoint = "/";
         device = "/dev/disk/by-label/nixos";
       }
-      { mountPoint = "/data";
+      { mountPoint = "/ephemeral0";
         device = "/dev/xvdc";
-        autocreate = true;
+        neededForBoot = true;
       }
     ];
 
@@ -71,11 +71,27 @@ with pkgs.lib;
   boot.initrd.kernelModules = [ "xen-blkfront" ];
   boot.kernelModules = [ "xen-netfront" ];
 
+  # Panic if an error occurs in stage 1, because there is nothing anybody can
+  # do about it.
+  boot.kernelParams = [ "stage1panic" ];
+
   # Generate a GRUB menu.  Amazon's pv-grub uses this to boot our kernel/initrd.
   boot.loader.grub.device = "nodev";
   boot.loader.grub.timeout = 0;
   boot.loader.grub.extraPerEntryConfig = "root (hd0)";
 
+  # Put /tmp and /var on /ephemeral0, which has a lot more space.  
+  # Unfortunately we can't do this with the `fileSystems' option 
+  # because it has no support for creating the source of a bind 
+  # mount.
+  boot.initrd.postMountCommands =
+    ''
+      mkdir -m 1777 -p $targetRoot/ephemeral0/tmp
+      mount --bind $targetRoot/ephemeral0/tmp $targetRoot/tmp
+      mkdir -m 755 -p $targetRoot/ephemeral0/var
+      mount --bind $targetRoot/ephemeral0/var $targetRoot/var
+    '';
+
   # There are no virtual consoles.
   services.mingetty.ttys = [ ];