Unify classes
[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: Mon Sep 17 17:36:13 CEST 2007 [mika]
8 ################################################################################
9
10 set -u
11 set -e
12
13 # TODO: use extra files and class names instead of environment variabes
14
15 # supported environment variables for grml_cleanup_chroot:
16 #   NOCOLORS: if set it disables colors in (debugging) output
17 #   LATEX_CLEANUP: remove some big directories of texlive (/usr/share/doc/texlive-*)
18 #   NOONLINE: disable functions that require working network setup
19 #   FAST: skip some longer tasks
20 #   REMOVE_DOCS: rm -rf /usr/share/doc + /usr/share/info
21
22 if ifclass GRML_SMALL ; then
23    cp /etc/grml/fai/grml/grml_cleanup_chroot.small $target/root/
24    $ROOTCMD sh -c "NOCOLORS=1 /root/grml_cleanup_chroot.small"
25    rm $target/root/grml_cleanup_chroot.small
26 fi
27
28 if ifclass REMOVE_DOCS ; then
29    $ROOTCMD sh -c "NOCOLORS=1 REMOVE_DOCS=1 /root/grml_cleanup_chroot.small"
30    rm $target/root/grml_cleanup_chroot.small
31 fi
32
33 # final cleanup
34 cp /etc/grml/fai/grml/grml_cleanup_chroot $target/root/
35 $ROOTCMD sh -c "NOCOLORS=1 /root/grml_cleanup_chroot"
36 rm $target/root/grml_cleanup_chroot
37
38 ## END OF FILE #################################################################
39 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3