kpatch: do not rm selinux rpm owned directory As part of the kpatch rpm package installation, the /var/lib/kpatch directory gets created and is set to be selinux owned by the kpatch rpm package. There is a problem where uninstalling the last kpatch-patch will also remove this directory. When another kpatch-patch installation occurs, the /var/lib/kpatch get recreated but withtout the selinux context which triggers a policy error. Since /var/lib/kpatch is now created by the rpm spec file, do not remove it from the uinstall target of the kpatch script. This insures selinux context consistency. RHEL-only. Signed-off-by: Yannick Cote --- a/kpatch/kpatch +++ b/kpatch/kpatch @@ -610,7 +610,6 @@ case "$1" in echo "uninstalling $PATCH ($KVER)" rm -f "$MODULE" || die "failed to uninstall module $PATCH" rmdir --ignore-fail-on-non-empty "$INSTALLDIR/$KVER" || die "failed to remove directory $INSTALLDIR/$KVER" - rmdir --ignore-fail-on-non-empty "$INSTALLDIR" || die "failed to remove directory $INSTALLDIR" ;;