summaryrefslogtreecommitdiff
path: root/scripts/build/lb_chroot_hacks
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2011-08-04 19:46:35 +0200
committerintrigeri <intrigeri@boum.org>2011-08-04 19:46:35 +0200
commitd8ac62a9ec105c80163a025ad06a2d91bca8b753 (patch)
tree1fa779a68fd9245d5e1ef011c0349bbf1787551f /scripts/build/lb_chroot_hacks
parent1deaeb04e59c4afd76d69b53d4e9ffc2a9a7b930 (diff)
downloadvyos-live-build-d8ac62a9ec105c80163a025ad06a2d91bca8b753.tar.gz
vyos-live-build-d8ac62a9ec105c80163a025ad06a2d91bca8b753.zip
Cleaning up temporary directories at the same time as other cruft.
Diffstat (limited to 'scripts/build/lb_chroot_hacks')
-rwxr-xr-xscripts/build/lb_chroot_hacks8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/build/lb_chroot_hacks b/scripts/build/lb_chroot_hacks
index eed0294d8..57f5769fa 100755
--- a/scripts/build/lb_chroot_hacks
+++ b/scripts/build/lb_chroot_hacks
@@ -226,6 +226,14 @@ rm -f chroot/var/cache/debconf/*-old
rm -f chroot/var/lib/dpkg/*-old
rm -f chroot/var/log/apt/term.log
+# Delete and re-create temporary directories
+TEMP_DIRS="/tmp /var/tmp"
+for DIR in ${TEMP_DIRS}
+do
+ rm -rf "chroot/${DIR}"
+ install -d -m 1777 "chroot/${DIR}"
+done
+
if [ -n "${LB_ROOT_COMMAND}" ]
then
${LB_ROOT_COMMAND} chown -R --quiet $(whoami):$(whoami) chroot