From 4bd15378602162acacbf06c41e96e6311acc224f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 29 Oct 2008 15:43:37 +0000 Subject: [PATCH] * Create /nix/var/nix/chroots in the activation script and re-create it at boot time. svn path=/nixos/trunk/; revision=13152 --- boot/boot-stage-2-init.sh | 6 ++++++ system/activate-configuration.sh | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/boot/boot-stage-2-init.sh b/boot/boot-stage-2-init.sh index 01963d43cc1..f5fd818d3c7 100644 --- a/boot/boot-stage-2-init.sh +++ b/boot/boot-stage-2-init.sh @@ -87,6 +87,12 @@ rm -rf /var/run #rm -rf --one-file-system /tmp/* #echo " done" +# This is a good time to clean up /nix/var/nix/chroots. Doing an `rm +# -rf' on it isn't safe in general because it can contain bind mounts +# to /nix/store and other places. But after rebooting these are all +# gone, of course. +rm -rf /nix/var/nix/chroots # recreated in activate-configuration.sh + if test -n "$safeMode"; then mkdir -m 0755 -p /var/run touch /var/run/safemode diff --git a/system/activate-configuration.sh b/system/activate-configuration.sh index c7b1b412841..6db13c6ab36 100644 --- a/system/activate-configuration.sh +++ b/system/activate-configuration.sh @@ -121,7 +121,8 @@ mkdir -m 0755 -p \ /nix/var/nix/profiles \ /nix/var/nix/db \ /nix/var/log/nix/drvs \ - /nix/var/nix/channel-cache + /nix/var/nix/channel-cache \ + /nix/var/nix/chroots mkdir -m 1777 -p /nix/var/nix/gcroots/per-user mkdir -m 1777 -p /nix/var/nix/profiles/per-user