Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/provision/write_zeroes.sh
diff options
context:
space:
mode:
Diffstat (limited to 'provision/write_zeroes.sh')
-rw-r--r--provision/write_zeroes.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/provision/write_zeroes.sh b/provision/write_zeroes.sh
new file mode 100644
index 0000000..a7fac3e
--- /dev/null
+++ b/provision/write_zeroes.sh
@@ -0,0 +1,10 @@
+#/bin/bash
+
+set -e
+set -x
+
+# Write zeros to improve virtual disk compaction.
+zerofile=$(/usr/bin/mktemp /zerofile.XXXXX)
+dd if=/dev/zero of="$zerofile" bs=1M || true
+rm -f "$zerofile"
+sync