X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fgrml%2Fgrml_cleanup_chroot;h=8eba963ffb4b6ffe526a6a70fcb8d32a94799a1f;hb=173d53d88230d3ca786ac2908bfdafcc5a50f555;hp=e93f17541c7b5f055eb32409847087856627b16d;hpb=aadaee58928e09263952ff90543024c65d426e4f;p=grml-live.git diff --git a/etc/grml/fai/grml/grml_cleanup_chroot b/etc/grml/fai/grml/grml_cleanup_chroot index e93f175..8eba963 100755 --- a/etc/grml/fai/grml/grml_cleanup_chroot +++ b/etc/grml/fai/grml/grml_cleanup_chroot @@ -4,7 +4,7 @@ # Authors: (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Wed Sep 19 13:38:45 CEST 2007 [mika] +# Latest change: Sun Nov 04 12:12:57 CET 2007 [mika] ################################################################################ # misc stuff @@ -52,9 +52,27 @@ einfo "Setting up /etc/inittab" cp /etc/inittab.grml /etc/inittab eend $? -einfo "Cleaning up /usr/src/linux-headers-$KERNEL" -( cd /usr/src && make clean && make symlinks ) -eend $? +if [ "$(dpkg --list | awk '/^rc/ { print $2}')" != '' ] ; + einfo "Purging removed packages" + dpkg --purge $(dpkg --list | awk '/^rc/ { print $2}') + eend $? +fi + +if [ -x /usr/bin/make -a -r /usr/src/Makefile ] ; then + einfo "Cleaning up /usr/src/linux-headers-$KERNEL" + ( cd /usr/src + VER=$(/bin/ls -d /usr/src/linux-headers-* | head -1) + VER=${VER##/usr/src/linux-headers-} + if [ -n "$VER" ] ; then + VER=$VER make clean && \ + VER=$VER make symlinks + else + make clean && \ + make symlinks + fi + ) + eend $? +fi if [ -L /usr/include/linux ] ; then einfo "/usr/include/linux is ok" ; eend 0 @@ -62,15 +80,14 @@ 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 + ewarn "Warning: /usr/src/linux-headers-$KERNEL not found, exiting." ; eend 0 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 + 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 "linux-headers-$KERNEL not installed." ; eend 0 + ewarn "Warning: linux-headers-$KERNEL not installed." ; eend 0 fi einfo "Creating ~/.zshrc"