X-Git-Url: http://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fconfig%2Fscripts%2FGRMLBASE%2F98-clean-chroot;h=b5f193e0bf3729640451abe3171a4f7ebc58fe2c;hp=76429503b40e7b42949a77bbaabdace7aa1bdebd;hb=5b318a466ad39b55e4244d0904548376f94fef9f;hpb=bc3fb695369f16a11cbbb6ab57bd7d6898fe6f52 diff --git a/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot b/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot index 7642950..b5f193e 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot +++ b/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2 or any later version. -# Latest change: Wed Sep 19 13:51:05 CEST 2007 [mika] +# Latest change: Sat Sep 06 20:05:02 CEST 2008 [mika] ################################################################################ set -e @@ -18,18 +18,36 @@ fi # skip tasks which require only when using class NO_ONLINE: if ! ifclass NO_ONLINE ; then - cp /etc/grml/fai/grml/grml_cleanup_chroot.no_online $target/root/ - $ROOTCMD /root/grml_cleanup_chroot.no_online - rm $target/root/grml_cleanup_chroot.no_online + cp /etc/grml/fai/grml/grml_cleanup_chroot.online $target/root/ + $ROOTCMD /root/grml_cleanup_chroot.online + rm $target/root/grml_cleanup_chroot.online +fi + +# make sure to drop from grml-small what's unnecessary: +if ifclass GRML_SMALL ; then + $ROOTCMD apt-get -y --purge remove aptitude + for pkg in groff-base info locales man-db manpages nano; do + $ROOTCMD dpkg --purge $pkg || true + done +fi + +# drop unnecessary software: +if ifclass GRML_SMALL || ifclass DEBORPHAN ; then + if [ -f /etc/grml/fai/grml/grml_cleanup_chroot.deborphan ] ; then + cp /etc/grml/fai/grml/grml_cleanup_chroot.deborphan $target/root/ + $ROOTCMD /root/grml_cleanup_chroot.deborphan + rm $target/root/grml_cleanup_chroot.deborphan + fi fi # remove /usr/share/doc, /usr/share/info,... only in class REMOVE_DOCS: +# (important: remove them *after* deinstalling packages, otherwise +# removing packages might fail due to lack of /usr/share/man/...) if ifclass REMOVE_DOCS ; then cp /etc/grml/fai/grml/grml_cleanup_chroot.remove_docs $target/root/ $ROOTCMD /root/grml_cleanup_chroot.remove_docs rm $target/root/grml_cleanup_chroot.remove_docs fi - # misc cleanup: if [ -f /etc/grml/fai/grml/grml_cleanup_chroot ] ; then cp /etc/grml/fai/grml/grml_cleanup_chroot $target/root/ @@ -43,5 +61,12 @@ if ifclass GRML_SMALL ; then cp $target/etc/runlevel.conf.livecd.small $target/etc/runlevel.conf fi +if ifclass RELEASE ; then + # Remove all FAI logs from chroot via grml-live later then: + touch $target/etc/grml_fai_release + # Remove all files inside /root/ of chroot: + rm -rf $target/root && mkdir -m 0755 $target/root +fi + ## END OF FILE ################################################################# # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3