Unify use of /etc/grml/fai/grml/grml_cleanup_chroot
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 98-clean-chroot
1 #!/bin/sh
2 # Filename:      /etc/grml/fai/config/scripts/GRML/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: Wed Sep 19 13:42:19 CEST 2007 [mika]
8 ################################################################################
9
10 set -e
11 set -u
12
13 # remove some big directories when using class LATEX_CLEANUP:
14 if ifclass LATEX_CLEANUP ; then
15    cp /etc/grml/fai/grml/grml_cleanup_chroot.latex_cleanup $target/root/
16    $ROOTCMD /root/grml_cleanup_chroot.latex_cleanup
17    rm $target/root/grml_cleanup_chroot.latex_cleanup
18 fi
19
20 # skip tasks which require only when using class NO_ONLINE:
21 if ! ifclass NO_ONLINE ; then
22    cp /etc/grml/fai/grml/grml_cleanup_chroot.no_online $target/root/
23    $ROOTCMD /root/grml_cleanup_chroot.no_online
24    rm $target/root/grml_cleanup_chroot.no_online
25 fi
26
27 # remove /usr/share/doc, /usr/share/info,... only in class REMOVE_DOCS:
28 if ifclass REMOVE_DOCS: ; then
29    cp /etc/grml/fai/grml/grml_cleanup_chroot.remove_docs $target/root/
30    $ROOTCMD /root/grml_cleanup_chroot.remove_docs
31    rm $target/root/grml_cleanup_chroot.remove_docs
32 fi
33
34 # misc cleanup:
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
39 # make sure GRML_SMALL uses the appropriate configuration:
40 if ifclass GRML_SMALL ; then
41    cp $target/etc/inittab.small $target/etc/inittab
42    cp $target/etc/runlevel.conf.livecd.small $target/etc/runlevel.conf
43 fi
44
45 ## END OF FILE #################################################################
46 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3