nixos-install: Handle /nix/var/nix/db being on a separate filesystem

This is the case on S3-backed EC2 instances.
This commit is contained in:
Eelco Dolstra 2013-01-25 15:59:53 +01:00
parent 8fe8ab7097
commit 6d19777455

View File

@ -42,6 +42,7 @@ fi
mkdir -m 0755 -p $mountPoint/dev $mountPoint/proc $mountPoint/sys $mountPoint/mnt $mountPoint/mnt2 $mountPoint/etc /etc/nixos
mount --make-private / # systemd makes / shared, which is annoying
mount --bind / $mountPoint/mnt
mount --bind /nix $mountPoint/mnt/nix
mount --bind /nix/store $mountPoint/mnt/nix/store
mount --bind /dev $mountPoint/dev
mount --bind /dev/shm $mountPoint/dev/shm
@ -61,6 +62,7 @@ cleanup() {
umount $mountPoint/dev/shm
umount $mountPoint/dev
umount $mountPoint/mnt/nix/store
umount $mountPoint/mnt/nix
umount $mountPoint/mnt
rmdir $mountPoint/mnt $mountPoint/mnt2
}