Merge branch 'upstream'
[automated-distro-installer] / fai / config / hooks / subroutines
diff --git a/fai/config/hooks/subroutines b/fai/config/hooks/subroutines
new file mode 100755 (executable)
index 0000000..816ead1
--- /dev/null
@@ -0,0 +1,31 @@
+#! /bin/bash
+
+# This file is sourced during task_setup
+# you can define your own functions and use them later, for e.g.
+# in scripts/...
+
+
+cleanup_base() {
+
+    rm -f $target/etc/mailname \
+       $target/etc/machine-id \
+       $target/var/lib/dbus/machine-id \
+       $target/var/log/install_packages.list
+
+    > $target/etc/machine-id
+    shred --remove $target/etc/ssh/ssh_host_*
+}
+
+
+cleanup_dpkg_apt() {
+
+    rm -f  $target/var/log/alternatives.log \
+       $target/var/log/apt/* \
+       $target/var/log/bootstrap.log \
+       $target/var/log/dpkg.log
+
+    rm -rf $target/var/cache/apt/*
+    rm -rf $target/var/lib/apt/lists/*
+    rm -f $target/var/lib/dpkg/available*
+    rm -f -- $target/var/lib/dpkg/*-old
+}