grml_cleanup_chroot: drop all [u]mount commands
[grml-live.git] / etc / grml / fai / grml / grml_cleanup_chroot
index 62902bb..9e78a9f 100755 (executable)
@@ -73,22 +73,6 @@ if [ -x /usr/bin/make -a -r /usr/src/Makefile ] ; then
    eend $?
 fi
 
-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
-       ewarn "Warning: /usr/src/linux-headers-$KERNEL not found, exiting." ; eend 0
-    fi
-elif [ -d /usr/src/linux-headers-"$KERNEL" ] ; then
-     ewarn "Warning: /usr/include/linux is NOT a symlink to /usr/src/linux/include/linux/ (possible an error)"
-     ewarn "Common reason: you forgot to install linux-kernel-headers-grml and use linux-libc-dev instead"
-     eend 0
-else
-     ewarn "Warning: linux-headers-$KERNEL not installed." ; eend 0
-fi
-
 einfo "Creating ~/.zshrc"
   touch ~/.zshrc
 eend $?
@@ -128,13 +112,6 @@ 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
@@ -163,14 +140,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
@@ -190,7 +168,7 @@ eend $?
 
 einfo "Removing x-server-conffiles"
   rm -f /etc/X11/xorg.conf /etc/X11/XF86Config-4 \
-        /etc/X11/XF86Config /etc/XF86Config /etc/XF86Config-4 
+        /etc/X11/XF86Config /etc/XF86Config /etc/XF86Config-4
 eend $?
 
 einfo "Removing ssh-keys"
@@ -351,25 +329,19 @@ 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
 # ~~~~~~~~~~
 # list dangling symlinks: ls **/*(-@)
 #
 # Security-audit:
-# find / \! -type l -perm -2000 -ls > audit/sgid-files 
+# find / \! -type l -perm -2000 -ls > audit/sgid-files
 # find / \! -type l -perm -0002 -ls > audit/world-writeable-files
 # find / \! -type l -perm -4000 -ls > audit/suid-files
 # find / ( -perm 4000 -o -perm -2000 \) -exec ls -ld {} \;
@@ -383,7 +355,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 
+# 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