Back to home page

LXR

 
 

    


0001 #!/bin/bash
0002 
0003 # because I use CONFIG_LOCALVERSION_AUTO, not the same version again and
0004 # again, /boot and /lib/modules/ eventually fill up.
0005 # Dumb script to purge that stuff:
0006 
0007 for f in "$@"
0008 do
0009         if rpm -qf "/lib/modules/$f" >/dev/null; then
0010                 echo "keeping $f (installed from rpm)"
0011         elif [ $(uname -r) = "$f" ]; then
0012                 echo "keeping $f (running kernel) "
0013         else
0014                 echo "removing $f"
0015                 rm -f "/boot/initramfs-$f.img" "/boot/System.map-$f"
0016                 rm -f "/boot/vmlinuz-$f"   "/boot/config-$f"
0017                 rm -rf "/lib/modules/$f"
0018                 new-kernel-pkg --remove $f
0019         fi
0020 done