From b297af42d257426bdce617f510381f19365bc69d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 3 Jan 2017 17:28:55 +0100 Subject: [PATCH] Fix using ephemeral disks for /tmp etc. in EC2 instances This code in amazon-image.nix: if mountFS "$device" "$mp" "" auto; then if [ -z "$diskForUnionfs" ]; then diskForUnionfs="$mp"; fi fi relies on mountFS to return a zero exit status if mounting succeeds. But the lustrateRoot check in mountFS was causing a non-zero exit status. As a result /disk0 would be mounted, but not used for /tmp. (cherry picked from commit d082ed8c35dec48aee2afd1303b3c8b2a1b242b0) --- nixos/modules/system/boot/stage-1-init.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh index 7803f1bd1aa..f0699ad9832 100644 --- a/nixos/modules/system/boot/stage-1-init.sh +++ b/nixos/modules/system/boot/stage-1-init.sh @@ -318,6 +318,8 @@ mountFS() { [ "$mountPoint" == "/" ] && [ -f "/mnt-root/etc/NIXOS_LUSTRATE" ] && lustrateRoot "/mnt-root" + + true } lustrateRoot () {