From 6d21e007767d5d8b7bd28c4118b3da3fd699290a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 20 Jan 2010 18:06:33 +0000 Subject: [PATCH] * Some hacks to support running NixOS on Amazon EC2 (and other hosting environment where you don't get to run stage 1 of the boot). svn path=/nixos/trunk/; revision=19579 --- modules/system/boot/stage-2-init.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/system/boot/stage-2-init.sh b/modules/system/boot/stage-2-init.sh index adab3bf5d06d..0ce9f90a54ef 100644 --- a/modules/system/boot/stage-2-init.sh +++ b/modules/system/boot/stage-2-init.sh @@ -3,6 +3,11 @@ # !!! copied from stage 1; remove duplication +# If no `systemConfig' parameter is specified on the kernel command +# line, use `/system' as a fallback. +systemConfig=/system + + # Print a greeting. echo echo -e "\e[1;32m<<< NixOS Stage 2 >>>\e[0m" @@ -24,6 +29,13 @@ setPath() { setPath "@path@" +# Normally, stage 1 mounts the root filesystem read/writable. +# However, in some environments (such as Amazon EC2), stage 2 is +# executed directly, and the root is read-only. So make it writable +# here. +mount -n -o remount,rw none / + + # Mount special file systems. mkdir -m 0755 -p /etc test -e /etc/fstab || touch /etc/fstab # to shut up mount