vz-postinstall: add way to disable distro kernels

This is a frequent problem with e.g. CentOS then a new distro kernel
is installed and becomes bootable by default, so OpenVZ features are
lost.

A very easy way to prevent this is to set 'exclude=kernel' in
/etc/yum.conf. This doesn't affect OpenVZ kernels as they are
named vzkernel.

Run this on install, and clean up our changes on uninstall so
if vzctl is removed stock distro kernels will continue to be
updated.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
2 files changed