X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fgrml%2Fgrml_cleanup_chroot;h=5c591ef61f7b2970222c0733c02aba4030ff70b3;hb=96e44eeeef0dfb39e305faeede9afdf7bc0ee9af;hp=1e01e40da5469d248b16f3137a67d3c6d3065a03;hpb=97e3cccdc3cc6e992cc4c485ee445adaaa396ac4;p=grml-live-grml.git diff --git a/etc/grml/fai/grml/grml_cleanup_chroot b/etc/grml/fai/grml/grml_cleanup_chroot index 1e01e40..5c591ef 100755 --- a/etc/grml/fai/grml/grml_cleanup_chroot +++ b/etc/grml/fai/grml/grml_cleanup_chroot @@ -77,14 +77,6 @@ einfo "Creating ~/.zshrc" touch ~/.zshrc eend $? -if [ -r /usr/share/lintian/overrides/ion3 ] ; then - einfo "Stripping ion3-stuff" - cat /usr/share/lintian/overrides/ion3 | sed 's#.*./usr#/usr#' | \ - sed 's/.comment//' | xargs strip --strip-unneeded ; eend $? -else - ewarn "ion3 not installed" ; eend 0 -fi - if [ -d /usr/lib/valgrind/x86-linux/ ] ; then einfo "Stripping /usr/lib/valgrind/x86-linux/" strip --strip-unneeded /usr/lib/valgrind/x86-linux/* @@ -100,25 +92,11 @@ else ewarn "localepurg not available" ; eend 0 fi -if [ -d /var/lib/backuppc/pc/localhost/ ] ; then - einfo "Cleaning /var/lib/backuppc/pc/localhost/" - rm -rf /var/lib/backuppc/pc/localhost/* ; eend $? -else - ewarn "backuppc not installed" ; eend 0 -fi - # find /var -name \*.pid einfo "Removing pid-files" find /var/run -name \*.pid -exec rm {} \; eend $? -einfo "Unmounting proc, /dev/pts, /dev/capi" - umount /proc 2>/dev/null - umount /dev/pts 2>/dev/null - umount /dev/capi 2>/dev/null - umount -a 2>/dev/null -eend $? - einfo "Removing /var/lib/apt/lists/*-stuff, dpkg-status-old and pkgcache.bin" rm -f /var/lib/apt/lists/*Packages rm -f /var/lib/apt/lists/*Release @@ -147,14 +125,15 @@ fi # get rid of large kernel modules: if ifclass GRML_SMALL ; then + einfo "Identified grml-small, removing some very large kernel drivers:" if [ -r "/lib/modules/${KERNEL}/kernel/fs/ocfs2/ocfs2.ko" ] ; then einfo "Removing /lib/modules/${KERNEL}/kernel/fs/ocfs2/ocfs2.ko" rm -f "/lib/modules/${KERNEL}/kernel/fs/ocfs2/ocfs2.ko" eend $? fi - if [ -r "/lib/modules/${KERNEL}/kernel/drivers/isdn/hisax/hisax.ko" ] ; then - einfo "Removing /lib/modules/${KERNEL}/kernel/drivers/isdn/hisax/hisax.ko" - rm -f "/lib/modules/${KERNEL}/kernel/drivers/isdn/hisax/hisax.ko" + if [ -d "/lib/modules/${KERNEL}/kernel/drivers/isdn/hisax/" ] ; then + einfo "Removing /lib/modules/${KERNEL}/kernel/drivers/isdn/hisax" + rm -rf "/lib/modules/${KERNEL}/kernel/drivers/isdn/hisax" eend $? fi fi @@ -168,10 +147,6 @@ else ewarn "Warning: /usr/bin/grep-dctrl not available." fi -einfo "Copying original runlevel.conf to /etc/runlevel.conf" -cp /etc/runlevel.conf.livecd /etc/runlevel.conf -eend $? - einfo "Removing x-server-conffiles" rm -f /etc/X11/xorg.conf /etc/X11/XF86Config-4 \ /etc/X11/XF86Config /etc/XF86Config /etc/XF86Config-4 @@ -239,12 +214,14 @@ else fi einfo "Cleaning and removing some misc files and directories" + find /etc -type f -name *.pre_fcopy -delete rm -f /etc/sysconfig/* /etc/motd.dpkg-new /etc/auto.master.distrib.dpkg-new \ /etc/samba/*.SID /etc/samba/*.tdb /dev/mouse* /dev/cdrom* /dev/cdwriter* \ /var/run/*/* /var/run/* /var/log/ksymoops/* /var/lock/*/* /var/lock/* \ /var/state/*/* /var/state/* /var/log/nessus/* \ /halt /reboot /ash.static /etc/dhcpc/*.info /etc/dhcpc/resolv* \ /etc/*passwd- /etc/*shadow- /etc/*group- /var/spool/postfix/maildrop/* \ + /etc/*.old /etc/*.original \ /etc/lvm/.cache /etc/lvm/cache/.cache /etc/lvm/backup/main 2>/dev/null rm -rf /tmp/* /var/tmp/* /var/tmp/.* /var/backups/* /.ssh /root/.ssh /home/*/.ssh \ /home/grml/* /home/grml/.??* /var/lib/texmf/ls-R /var/spool/texmf/ls-R \ @@ -321,10 +298,17 @@ fi # installation of resolvconf in chroot *with* /proc # is different from an installation without /proc, -# so make sure it is OK in any case; don't use /dev/shm +# so make sure it is OK in any case if [ -d /etc/resolvconf ] ; then - rm -rf /etc/resolvconf/run - mkdir /etc/resolvconf/run + if [ -L /etc/resolvconf/run ] ; then # resolvconf with /run + # /etc/resolvconf/run symlinks to /run/resolvconf + rm -rf /run/resolvconf + mkdir -p /run/resolvconf + else # no /run present + rm -rf /etc/resolvconf/run + mkdir /etc/resolvconf/run + fi + touch /etc/resolvconf/run/enable-updates mkdir /etc/resolvconf/run/interface cat > /etc/resolvconf/run/resolv.conf << EOF @@ -335,18 +319,12 @@ fi if [ -x /usr/bin/updatedb ] ; then einfo "Updating locate-database" - mount -t proc none /proc updatedb --prunepaths='/tmp /usr/tmp /var/tmp /grml /root /proc /sys' - umount /proc eend $? else ewarn "updatedb not installed" ; eend 0 fi -einfo "Unmounting all filesystems" - umount -a -eend $? - ################################################################################ # MISC STUFF # ~~~~~~~~~~ @@ -367,10 +345,7 @@ eend $? # file /usr/sbin/* | grep -v ', stripped' | grep -v 'perl' | grep -v 'Bourne' | grep -v 'python' | grep -v 'symbolic link' # # Is software by grml-repos up2date? -# grep-dctrl --field Maintainer 'Michael Prokop' /var/lib/apt/lists/grml.org_repos_._* | grep Package | awk '{print $2}' | xargs echo -# -# runlevel.conf: -# for file in /etc/init.d/* ; do grep $file -q /etc/runlevel.conf.hdinstall || echo $file not found ; done +# grep-dctrl --field Maintainer 'Michael Prokop' /var/lib/apt/lists/* | grep Package | awk '{print $2}' | xargs echo ################################################################################ ## END OF FILE #################################################################