live-build/examples/hooks/all_chroot_minimal.sh

34 lines
720 B
Bash
Raw Normal View History

2007-09-23 08:04:48 +00:00
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
##
## live-build comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
2007-09-23 08:04:48 +00:00
set -e
2007-09-23 08:04:46 +00:00
# Removing unused packages
for PACKAGE in apt-utils aptitude man-db manpages info wget
do
2007-09-23 08:05:14 +00:00
if ! apt-get remove --purge --yes "${PACKAGE}"
then
echo "WARNING: ${PACKAGE} isn't installed"
fi
done
apt-get autoremove --yes || true
2007-09-23 08:04:46 +00:00
# Removing unused files
find . -name *~ -print0 | xargs -0 rm -f
2007-09-23 08:04:50 +00:00
2007-09-23 08:04:46 +00:00
rm -rf /var/cache/man/*
# Truncating logs
for FILE in $(find /var/log/ -type f)
2007-09-23 08:04:46 +00:00
do
: > ${FILE}
2007-09-23 08:04:46 +00:00
done