From a242602b40284e16f748372b25f9d4e9b1df26e2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 29 Aug 2010 22:09:15 +0000 Subject: [PATCH] * /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 --- modules/virtualisation/amazon-image.nix | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/modules/virtualisation/amazon-image.nix b/modules/virtualisation/amazon-image.nix index a81f40cc759e..ac31f67cf1a5 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 = [ ];