2 # Filename: ${GRML_FAI_CONFIG}/config/scripts/RELEASE/98-clean-chroot
3 # Purpose: clean up $HOMEs for release
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2 or any later version.
7 ################################################################################
13 echo "Removing /var/lib/apt/lists/*-stuff, dpkg-status-old and pkgcache.bin"
14 rm -f $target/var/lib/apt/lists/*Packages \
15 $target/var/lib/apt/lists/*Release \
16 $target/var/lib/apt/lists/*Sources \
17 $target/var/lib/apt/lists/*Index* \
18 $target/var/lib/apt/lists/*Translation* \
19 $target/var/lib/apt/lists/*.gpg \
20 $target/var/cache/apt-show-versions/* \
21 $target/var/cache/debconf/*.dat-old \
22 $target/var/cache/apt/*.bin
24 echo "Removing /var/lib/aptitude/pkgstates.old"
25 rm -f "${target}/var/lib/aptitude/pkgstates.old"
27 # Remove all FAI logs from chroot via grml-live later then
28 echo "Setting up /etc/grml_fai_release for grml-live"
29 touch $target/etc/grml_fai_release
31 echo "Removing all files inside /root"
33 mkdir -m 0755 $target/root
35 echo "Removing all files inside /home/${USERNAME}"
36 rm -rf "${target}/home/${USERNAME}"
37 mkdir -m 0755 "${target}/home/${USERNAME}"
38 $ROOTCMD chown "${USERNAME}:${USERNAME}" "/home/${USERNAME}"
40 echo "Syncing /home/${USERNAME}/ with data from /etc/skel/:"
41 $ROOTCMD su -s /bin/sh "${USERNAME}" -c "rsync -Hav /etc/skel/ /home/${USERNAME}/"
43 ## END OF FILE #################################################################
44 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2