While patching the kernel, don't remove all kernel sources
Just (re)install the right package.

Also some cosmetics and add a fail message.