Remove the policy.kern after policy is build and replace with symbolic link.
We want to shink the space required by selinux-policy for small cloud images.
This file has no purpose after policy is built.
diff --git a/libsemanage/src/semanage_store.c b/libsemanage/src/semanage_store.c
index 57ef49f..4b040c3 100644
--- a/libsemanage/src/semanage_store.c
+++ b/libsemanage/src/semanage_store.c
@@ -1234,6 +1234,10 @@
retval = 0;
cleanup:
+ (void) unlink(active_kernel);
+ if (symlink(store_pol, active_kernel) < 0) {
+ ERR(sh, "Unable to create sybolic link from %s to %s error code %d.", active_kernel, store_pol, r);
+ }
free(storepath);
return retval;
}