From 4931188684547230342024c512dca2e82dd84509 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Mon, 11 Jun 2012 07:05:13 +0000 Subject: [PATCH] Integrate cleanTmpDir in stage-2-init.sh. We're using find in order to remove dotfiles, too. svn path=/nixos/trunk/; revision=34433 --- modules/system/boot/stage-2-init.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/system/boot/stage-2-init.sh b/modules/system/boot/stage-2-init.sh index f02149ced75..cc0f8befae8 100644 --- a/modules/system/boot/stage-2-init.sh +++ b/modules/system/boot/stage-2-init.sh @@ -102,16 +102,18 @@ mkdir -m 0755 -p /etc/nixos rm -rf /var/run /var/lock /var/log/upstart rm -f /etc/resolv.conf -#echo -n "cleaning \`/tmp'..." -#rm -rf --one-file-system /tmp/* -#echo " done" +if test -n "@cleanTmpDir@"; then + echo -n "cleaning \`/tmp'..." + find /tmp -maxdepth 1 -mindepth 1 -print0 | xargs -0r rm -rf --one-file-system + echo " done" +else + # Get rid of ICE locks... + rm -rf /tmp/.ICE-unix +fi - -# Get rid of ICE locks and ensure that it's owned by root. -rm -rf /tmp/.ICE-unix +# ... and ensure that it's owned by root. mkdir -m 1777 /tmp/.ICE-unix - # 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