X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fhooks%2Fsubroutines;fp=fai%2Fconfig%2Fhooks%2Fsubroutines;h=816ead131d9f948677f830de8b07e981826aa08a;hb=edb1a99660561c51aa5c7803d978284c7b423842;hp=0000000000000000000000000000000000000000;hpb=936324619541130f4ab07bd4633f48eb81812613;p=automated-distro-installer diff --git a/fai/config/hooks/subroutines b/fai/config/hooks/subroutines new file mode 100755 index 0000000..816ead1 --- /dev/null +++ b/fai/config/hooks/subroutines @@ -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 +}