Rework FAI logs removing
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 98-clean-chroot
1 #!/bin/sh
2 # Filename:      /etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot
3 # Purpose:       clean up chroot system
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 # Latest change: Sun Nov 04 12:11:32 CET 2007 [mika]
8 ################################################################################
9
10 set -e
11
12 # remove some big directories when using class LATEX_CLEANUP:
13 if ifclass LATEX_CLEANUP ; then
14    cp /etc/grml/fai/grml/grml_cleanup_chroot.latex_cleanup $target/root/
15    $ROOTCMD  /root/grml_cleanup_chroot.latex_cleanup
16    rm $target/root/grml_cleanup_chroot.latex_cleanup
17 fi
18
19 # skip tasks which require only when using class NO_ONLINE:
20 if ! ifclass NO_ONLINE ; then
21    cp /etc/grml/fai/grml/grml_cleanup_chroot.online $target/root/
22    $ROOTCMD  /root/grml_cleanup_chroot.online
23    rm $target/root/grml_cleanup_chroot.online
24 fi
25
26 # remove /usr/share/doc, /usr/share/info,... only in class REMOVE_DOCS:
27 if ifclass REMOVE_DOCS ; then
28    cp /etc/grml/fai/grml/grml_cleanup_chroot.remove_docs $target/root/
29    $ROOTCMD  /root/grml_cleanup_chroot.remove_docs
30    rm $target/root/grml_cleanup_chroot.remove_docs
31 fi
32
33 # misc cleanup:
34 if [ -f /etc/grml/fai/grml/grml_cleanup_chroot ] ; then
35    cp /etc/grml/fai/grml/grml_cleanup_chroot $target/root/
36    $ROOTCMD  /root/grml_cleanup_chroot
37    rm $target/root/grml_cleanup_chroot
38 fi
39
40 # make sure GRML_SMALL uses the appropriate configuration:
41 if ifclass GRML_SMALL ; then
42    cp $target/etc/inittab.small $target/etc/inittab
43    cp $target/etc/runlevel.conf.livecd.small $target/etc/runlevel.conf
44 fi
45
46 # Remove all FAI logs from chroot via grml-live then:
47 if ifclass RELEASE ; then
48    touch $target/var/log/fai/release
49 fi
50
51 ## END OF FILE #################################################################
52 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3