summarylogtreecommitdiffstats
path: root/selinux-refpolicy-arch.install
diff options
context:
space:
mode:
authorNicolas Iooss2017-08-14 21:15:22 +0200
committerNicolas Iooss2017-08-14 21:15:22 +0200
commit52fcaececc51507309cb0642422a78e225cb7ed7 (patch)
tree6d04b1b15d700ef4316cb2a17f39c75d0a80bd32 /selinux-refpolicy-arch.install
parent078674e43f9cc83bf869b8a00fd9083184f5c347 (diff)
downloadaur-52fcaececc51507309cb0642422a78e225cb7ed7.tar.gz
selinux-refpolicy-arch 20170805-1 update
Diffstat (limited to 'selinux-refpolicy-arch.install')
-rw-r--r--selinux-refpolicy-arch.install25
1 files changed, 23 insertions, 2 deletions
diff --git a/selinux-refpolicy-arch.install b/selinux-refpolicy-arch.install
index 7fa114395de..21ce9e87e65 100644
--- a/selinux-refpolicy-arch.install
+++ b/selinux-refpolicy-arch.install
@@ -1,5 +1,20 @@
post_install() {
- echo ">>> Loading refpolicy-arch. Please wait ..."
+ # Configure /etc/selinux/config
+ if [ -e /etc/selinux/config ]
+ then
+ echo ">>> In order to use this policy, set SELINUXTYPE=refpolicy-arch in /etc/selinux/config."
+ else
+ /usr/bin/ln -v -s config.refpolicy-arch /etc/selinux/config
+ fi
+
+ # In release 20170805, apm module has been renamed to acpi. This causes a
+ # conflict when rebuilding the policy
+ if /usr/bin/semodule -s refpolicy-arch -l 2>/dev/null | /usr/bin/grep -q '^apm$'
+ then
+ semodule --noreload -s refpolicy-arch -r apm
+ fi
+
+ echo ">>> Building refpolicy-arch policy store. Please wait..."
/usr/bin/semodule -s refpolicy-arch -i /usr/share/selinux/refpolicy-arch/*.pp
echo ">>> Relabeling the filesystem may be needed."
echo ">>> This can be done with: /usr/bin/restorecon -rF /"
@@ -11,5 +26,11 @@ post_upgrade() {
post_remove() {
echo ">>> Removing refpolicy left-over files."
- /bin/rm -rf /etc/selinux/refpolicy-arch
+ /usr/bin/rm -rf /etc/selinux/refpolicy-arch
+
+ if [ -L /etc/selinux/config ] && ! [ -e /etc/selinux/config ]
+ then
+ echo ">>> Removing now-broken symbolic link /etc/selinux/config"
+ /usr/bin/rm /etc/selinux/config
+ fi
}