summaryrefslogtreecommitdiffstats
path: root/hosts/profitbricks-build4-amd64/etc/pbuilder/rebuild-hooks/B01_cleanup
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-09-23 00:27:29 +0200
committerHolger Levsen <holger@layer-acht.org>2015-09-23 00:27:29 +0200
commitb2af898af134153bb1b6a9da96693a4092a896ca (patch)
tree6c97b90592628468623b850e5d33ed31f89c75a0 /hosts/profitbricks-build4-amd64/etc/pbuilder/rebuild-hooks/B01_cleanup
parenteb4df47512bd74b06686f841edded7cf23b16d70 (diff)
downloadjenkins.debian.net-b2af898af134153bb1b6a9da96693a4092a896ca.tar.xz
reproducible: use disorderfs on every 2nd build
Diffstat (limited to 'hosts/profitbricks-build4-amd64/etc/pbuilder/rebuild-hooks/B01_cleanup')
-rwxr-xr-xhosts/profitbricks-build4-amd64/etc/pbuilder/rebuild-hooks/B01_cleanup15
1 files changed, 15 insertions, 0 deletions
diff --git a/hosts/profitbricks-build4-amd64/etc/pbuilder/rebuild-hooks/B01_cleanup b/hosts/profitbricks-build4-amd64/etc/pbuilder/rebuild-hooks/B01_cleanup
new file mode 100755
index 00000000..c60a991c
--- /dev/null
+++ b/hosts/profitbricks-build4-amd64/etc/pbuilder/rebuild-hooks/B01_cleanup
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+# exit if we are in the same UTS namespace as init ( != 2nd build )
+[ "$(readlink /proc/1/ns/uts)" = "$(readlink /proc/self/ns/uts)" ] && exit 0
+
+# cease using disorderfs
+if [ -d /tmp/disorderfs ] ; then
+ echo -n "Unmounting /tmp/disorderfs…"
+ fusermount -u /tmp/buildd
+ rmdir /tmp/buildd
+ mv /tmp/disorderfs /tmp/buildd
+ echo " done."
+fi