From: Michael Prokop Date: Mon, 17 Sep 2007 15:36:45 +0000 (+0200) Subject: Adjust cleanup script for grml-small vs. grml X-Git-Tag: 0.0.1~28 X-Git-Url: http://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=7280b17f3796971162b0da54e0a5d5d43878f394 Adjust cleanup script for grml-small vs. grml --- diff --git a/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot b/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot index 9aac395..02665f6 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: Mon Sep 17 17:02:43 CEST 2007 [mika] +# Latest change: Mon Sep 17 17:36:13 CEST 2007 [mika] ################################################################################ set -u diff --git a/etc/grml/fai/config/scripts/GRML_SMALL/98-clean-chroot b/etc/grml/fai/config/scripts/GRML_SMALL/98-clean-chroot index 9161743..1ff34af 100755 --- a/etc/grml/fai/config/scripts/GRML_SMALL/98-clean-chroot +++ b/etc/grml/fai/config/scripts/GRML_SMALL/98-clean-chroot @@ -1,25 +1,22 @@ #!/bin/sh -# Filename: /etc/grml/fai/config/scripts/GRML/98-clean-chroot +# Filename: /etc/grml/fai/config/scripts/GRML_SMALL/98-clean-chroot # Purpose: clean up chroot system # 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: Mon Sep 17 17:03:12 CEST 2007 [mika] +# Latest change: Mon Sep 17 17:36:11 CEST 2007 [mika] ################################################################################ set -u set -e -# supported environment variables for grml_cleanup_chroot: +# supported environment variables of grml_cleanup_chroot.small: # NOCOLORS: if set it disables colors in (debugging) output -# LATEX_CLEANUP: remove some big directories of texlive (/usr/share/doc/texlive-*) -# NOONLINE: disable functions that require working network setup -# FAST: skip some longer tasks # REMOVE_DOCS: rm -rf /usr/share/doc + /usr/share/info -cp /etc/grml/fai/grml/grml_cleanup_chroot $target/root/ -$ROOTCMD sh -c "NOCOLORS=1 /root/grml_cleanup_chroot" -rm $target/root/grml_cleanup_chroot +cp /etc/grml/fai/grml/grml_cleanup_chroot.small $target/root/ +$ROOTCMD sh -c "NOCOLORS=1 /root/grml_cleanup_chroot.small" +rm $target/root/grml_cleanup_chroot.small ## END OF FILE ################################################################# # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3 diff --git a/etc/grml/fai/grml/grml_cleanup_chroot b/etc/grml/fai/grml/grml_cleanup_chroot index 9251d82..9b1cb2a 100755 --- a/etc/grml/fai/grml/grml_cleanup_chroot +++ b/etc/grml/fai/grml/grml_cleanup_chroot @@ -61,30 +61,24 @@ grep '^[a-z]' /etc/grml/modules >> /etc/modules eend 0 einfo "Setting up /etc/inittab" -if [ -z "$GRML_SMALL" ] ; then - cp /etc/inittab.grml /etc/inittab -else - cp /etc/inittab.small /etc/inittab -fi -eend 0 +cp /etc/inittab.grml /etc/inittab +eend $? -if [ -z "$GRML_SMALL" ] ; then - if [ -L /usr/include/linux ] ; then - einfo "/usr/include/linux is ok" ; eend 0 - elif [ -n "$GRML64" ] ; then - if [ -d /usr/src/linux-headers-"$KERNEL" ] ; then - einfo "grml64 detected, assuming /usr/src/linux-headers-$KERNEL is ok." ; eend 0 - else - eerror "/usr/src/linux-headers-$KERNEL not found, exiting." ; eend 1 - exit 10 - fi - elif [ -d /usr/src/linux-headers-"$KERNEL" ] ; then - eerror "/usr/include/linux is NOT a symlink to /usr/src/linux/include/linux/ - error" - eend 1 +if [ -L /usr/include/linux ] ; then + einfo "/usr/include/linux is ok" ; eend 0 +elif [ -n "$GRML64" ] ; then + if [ -d /usr/src/linux-headers-"$KERNEL" ] ; then + einfo "grml64 detected, assuming /usr/src/linux-headers-$KERNEL is ok." ; eend 0 + else + eerror "/usr/src/linux-headers-$KERNEL not found, exiting." ; eend 1 exit 10 - else - ewarn "linux-headers-$KERNEL not installed." ; eend 0 - fi + fi +elif [ -d /usr/src/linux-headers-"$KERNEL" ] ; then + eerror "/usr/include/linux is NOT a symlink to /usr/src/linux/include/linux/ - error" + eend 1 + exit 10 +else + ewarn "linux-headers-$KERNEL not installed." ; eend 0 fi einfo "Creating ~/.zshrc" @@ -158,11 +152,7 @@ else fi einfo "Copying original runlevel.conf to /etc/runlevel.conf" - if ! [ -z $GRML_SMALL ] ; then - cp /etc/runlevel.conf.livecd.small /etc/runlevel.conf - else - cp /etc/runlevel.conf.livecd /etc/runlevel.conf - fi +cp /etc/runlevel.conf.livecd /etc/runlevel.conf eend $? einfo "Removing x-server-conffiles" @@ -327,13 +317,6 @@ else fi if [ -n "$REMOVE_DOCS" ] ; then -# einfo "Cleaning up /etc/skel..." -# rm -rf /etc/skel/.fluxbox -# rm -rf /etc/skel/.gkrellm2 -# rm -rf /etc/skel/.idesktop -# rm -rf /etc/skel/.pekwm -# eend $? - einfo "Cleaning documentation directories..." if [ -d /usr/share/doc/grml-docs ] ; then mv /usr/share/doc/grml-docs /tmp/ diff --git a/etc/grml/fai/grml/grml_cleanup_chroot.small b/etc/grml/fai/grml/grml_cleanup_chroot.small new file mode 100755 index 0000000..a96a581 --- /dev/null +++ b/etc/grml/fai/grml/grml_cleanup_chroot.small @@ -0,0 +1,53 @@ +#!/bin/bash +# Filename: /etc/grml/fai/grml/grml_cleanup_chroot.small +# Purpose: clean up grml chroot (adjusted for grml-small) +# Authors: (c) Michael Prokop +# License: This file is licensed under the GPL v2. +# Latest change: Mon Sep 17 17:34:47 CEST 2007 [mika] +################################################################################ + +# misc stuff + umask 022 + [ -n "$NOCOLORS" ] || . /etc/grml_colors + . /etc/grml/lsb-functions || exit 6 + +einfo "Setting up /etc/inittab" +cp /etc/inittab.small /etc/inittab +eend $? + +einfo "Copying original runlevel.conf to /etc/runlevel.conf" +cp /etc/runlevel.conf.livecd.small /etc/runlevel.conf +eend $? + +if [ -n "$REMOVE_DOCS" ] ; then +# einfo "Cleaning up /etc/skel..." +# rm -rf /etc/skel/.fluxbox +# rm -rf /etc/skel/.gkrellm2 +# rm -rf /etc/skel/.idesktop +# rm -rf /etc/skel/.pekwm +# eend $? + + einfo "Cleaning documentation directories..." + if [ -d /usr/share/doc/grml-docs ] ; then + mv /usr/share/doc/grml-docs /tmp/ + fi + + rm -rf /usr/share/doc + mkdir /usr/share/doc + + if [ -d /tmp/grml-docs ] ; then + mv /tmp/grml-docs /usr/share/doc/grml-docs + fi + + rm -rf /usr/share/gtk-doc/ + rm -rf /usr/share/man/ + rm -rf /usr/man + rm -rf /usr/share/info + eend $? + + einfo "Creating /usr/share/info/..." + mkdir -p /usr/share/info/ + eend $? +fi + +## END OF FILE #################################################################