Got your solution: Just make a script like this:
Code:
#!/bin/bash
#Script to recursively erase a kernel install
rm -rf /lib/modules/"$1"
echo "Deleting direcotry /lib/modules/$1"
rm -f /boot/*"$1"
echo "Deleting kernel $1 from boot"
I can't make any promisses about the functionality of this script, it is VERY basic. Anyway it is a good idea to read about bash scripts before attemptint to use it.
Remember that you'd need to make executable by chmod u+x <scriptname>
You'd run it:
# <script> <kernel version to remove>
Hope this helps.
EDIT: Remember normally only root has write access to /boot and /lib/modules, so it would be advisable to save the file in /sbin or /usr/sbin
PS: This method works (as stated in the previous post) if you installed a kernel using the vmlinuz-<kernel version> way (make install) otherwise (bzImage) you would still need to manually remove the bzImage file.