diff options
author | Holger Paradies <retabell@gmx.de> | 2013-09-07 18:44:35 +0200 |
---|---|---|
committer | Andreas Loibl <andreas@andreas-loibl.de> | 2013-09-10 22:07:02 +0200 |
commit | ffcca3e8b3e5efefaad1c96482a8576c5fa41e03 (patch) | |
tree | 808e541128b76771c0eaa9f70aba209b492e3791 /config/chroot_local-hooks/xx-cleanup | |
parent | 9b63683dff36c48c5f746195d2ec083556d3b973 (diff) | |
download | kanotix-ffcca3e8b3e5efefaad1c96482a8576c5fa41e03.zip kanotix-ffcca3e8b3e5efefaad1c96482a8576c5fa41e03.tar.gz |
still another cleanup-hook created from lb-defaults
Diffstat (limited to 'config/chroot_local-hooks/xx-cleanup')
-rwxr-xr-x | config/chroot_local-hooks/xx-cleanup | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/config/chroot_local-hooks/xx-cleanup b/config/chroot_local-hooks/xx-cleanup new file mode 100755 index 0000000..b5b2adb --- /dev/null +++ b/config/chroot_local-hooks/xx-cleanup @@ -0,0 +1,45 @@ +#!/bin/sh + +set -e + +# file created from selected hooks from /usr/share/live/build/hooks/ + +# Remove backup files +rm -f /boot/*.bak +rm -f /boot/*.old-dkms + +rm -f /etc/apt/sources.list~ +rm -f /etc/apt/trusted.gpg~ + +rm -f /etc/passwd- +rm -f /etc/group- +rm -f /etc/shadow- +rm -f /etc/gshadow- + +rm -f /var/cache/debconf/*-old +rm -f /var/lib/dpkg/*-old + +# Truncate log files +for _FILE in $(find /var/log/ -type f) +do + : > ${_FILE} +done + + +# Remove Python *.py files. +# +# This removes byte-compiled Python modules to save some space. + +find /usr -name "*.pyc" -print0 | xargs -0r rm -f + + +# Remove temporary files +rm -rf /var/cache/man/* + +for _DIRECTORY in /tmp /var/tmp +do + rm -rf ${_DIRECTORY} + + mkdir -p ${_DIRECTORY} + chmod 1777 ${_DIRECTORY} +done |