0001
0002
0003
0004
0005
0006
0007
0008 for f in "$@"
0009 do
0010 if rpm -qf "/lib/modules/$f" >/dev/null; then
0011 echo "keeping $f (installed from rpm)"
0012 elif [ $(uname -r) = "$f" ]; then
0013 echo "keeping $f (running kernel) "
0014 else
0015 echo "removing $f"
0016 rm -f "/boot/initramfs-$f.img" "/boot/System.map-$f"
0017 rm -f "/boot/vmlinuz-$f" "/boot/config-$f"
0018 rm -rf "/lib/modules/$f"
0019 if [ -x "$(command -v new-kernel-pkg)" ]; then
0020 new-kernel-pkg --remove $f
0021 elif [ -x "$(command -v kernel-install)" ]; then
0022 kernel-install remove $f
0023 fi
0024 fi
0025 done