diff options
author | Philip Tricca <flihp@twobit.us> | 2016-04-04 00:21:33 +0000 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2016-04-04 12:55:56 -0400 |
commit | 14c84b182b1a5c8f2be057c9066ea809db9f9ba6 (patch) | |
tree | 38d9d86d8b6f615bf6c73f114bf865f2db1e869e | |
parent | fc122bb653c54ec54d4ed6add7154b43e118abb1 (diff) | |
download | meta-selinux-14c84b182b1a5c8f2be057c9066ea809db9f9ba6.tar.gz |
refpolicy: Setup virtual/refpolicy provider.
This allows us to provide a default policy through the
PREFERRED_PROVIDER mechanism for each of the example distro configs.
Consumers of meta-selinux will be able to override this at the config
level instead of having to depend on a specific policy package. We do
lose the ability install more than one policy package but this falls
in line with the embedded nature of the project.
Signed-off-by: Philip Tricca <flihp@twobit.us>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
5 files changed, 7 insertions, 5 deletions
diff --git a/conf/distro/oe-selinux.conf b/conf/distro/oe-selinux.conf index 6e55a32..0011d45 100644 --- a/conf/distro/oe-selinux.conf +++ b/conf/distro/oe-selinux.conf | |||
@@ -2,3 +2,4 @@ DISTRO = "oe-selinux" | |||
2 | DISTROOVERRIDES .= ":selinux" | 2 | DISTROOVERRIDES .= ":selinux" |
3 | 3 | ||
4 | DISTRO_FEATURES_append = " acl xattr pam selinux" | 4 | DISTRO_FEATURES_append = " acl xattr pam selinux" |
5 | PREFERRED_PROVIDER_virtual/refpolicy ?= "refpolicy-mls" | ||
diff --git a/recipes-security/packagegroups/packagegroup-core-selinux.bb b/recipes-security/packagegroups/packagegroup-core-selinux.bb index a2480a3..62c5a76 100644 --- a/recipes-security/packagegroups/packagegroup-core-selinux.bb +++ b/recipes-security/packagegroups/packagegroup-core-selinux.bb | |||
@@ -26,7 +26,6 @@ RDEPENDS_${PN} = " \ | |||
26 | selinux-autorelabel \ | 26 | selinux-autorelabel \ |
27 | selinux-init \ | 27 | selinux-init \ |
28 | selinux-labeldev \ | 28 | selinux-labeldev \ |
29 | refpolicy-standard \ | 29 | virtual/refpolicy \ |
30 | refpolicy-mls \ | ||
31 | coreutils \ | 30 | coreutils \ |
32 | " | 31 | " |
diff --git a/recipes-security/packagegroups/packagegroup-selinux-minimal.bb b/recipes-security/packagegroups/packagegroup-selinux-minimal.bb index 34c5f7c..87ae686 100644 --- a/recipes-security/packagegroups/packagegroup-selinux-minimal.bb +++ b/recipes-security/packagegroups/packagegroup-selinux-minimal.bb | |||
@@ -23,5 +23,5 @@ RDEPENDS_${PN} = "\ | |||
23 | policycoreutils-setfiles \ | 23 | policycoreutils-setfiles \ |
24 | selinux-config \ | 24 | selinux-config \ |
25 | selinux-labeldev \ | 25 | selinux-labeldev \ |
26 | refpolicy-mls \ | 26 | virtual/refpolicy \ |
27 | " | 27 | " |
diff --git a/recipes-security/refpolicy/refpolicy_common.inc b/recipes-security/refpolicy/refpolicy_common.inc index 67d0426..ba887e4 100644 --- a/recipes-security/refpolicy/refpolicy_common.inc +++ b/recipes-security/refpolicy/refpolicy_common.inc | |||
@@ -3,6 +3,9 @@ LICENSE = "GPLv2" | |||
3 | 3 | ||
4 | LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=393a5ca445f6965873eca0259a17f833" | 4 | LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=393a5ca445f6965873eca0259a17f833" |
5 | 5 | ||
6 | PROVIDES += "virtual/refpolicy" | ||
7 | RPROVIDES_${PN} += "virtual/refpolicy" | ||
8 | |||
6 | # Specific config files for Poky | 9 | # Specific config files for Poky |
7 | SRC_URI += "file://customizable_types \ | 10 | SRC_URI += "file://customizable_types \ |
8 | file://setrans-mls.conf \ | 11 | file://setrans-mls.conf \ |
diff --git a/recipes-security/selinux/selinux-config_0.1.bb b/recipes-security/selinux/selinux-config_0.1.bb index 37fe4b7..e902e98 100644 --- a/recipes-security/selinux/selinux-config_0.1.bb +++ b/recipes-security/selinux/selinux-config_0.1.bb | |||
@@ -1,4 +1,3 @@ | |||
1 | DEFAULT_POLICY ??= "mls" | ||
2 | DEFAULT_ENFORCING ??= "enforcing" | 1 | DEFAULT_ENFORCING ??= "enforcing" |
3 | 2 | ||
4 | SUMMARY = "SELinux configuration" | 3 | SUMMARY = "SELinux configuration" |
@@ -30,7 +29,7 @@ SELINUX=${DEFAULT_ENFORCING} | |||
30 | # mls - Multi Level Security protection. | 29 | # mls - Multi Level Security protection. |
31 | # targeted - Targeted processes are protected. | 30 | # targeted - Targeted processes are protected. |
32 | # mcs - Multi Category Security protection. | 31 | # mcs - Multi Category Security protection. |
33 | SELINUXTYPE=${DEFAULT_POLICY} | 32 | SELINUXTYPE=${@d.getVar("PREFERRED_PROVIDER_virtual/refpolicy", False)[len("refpolicy-"):]} |
34 | " > ${WORKDIR}/config | 33 | " > ${WORKDIR}/config |
35 | install -d ${D}/${sysconfdir}/selinux | 34 | install -d ${D}/${sysconfdir}/selinux |
36 | install -m 0644 ${WORKDIR}/config ${D}/${sysconfdir}/selinux/ | 35 | install -m 0644 ${WORKDIR}/config ${D}/${sysconfdir}/selinux/ |