aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXin Ouyang <xin.ouyang@windriver.com>2014-09-22 13:49:03 +0800
committerXin Ouyang <xin.ouyang@windriver.com>2014-09-22 14:05:21 +0800
commitb59250d423e9938ae934c201922141886e279188 (patch)
tree665a26eaf42e7cb1412a611657796b4ee0f3bcc5
parent261b8294533cc981ecec54c095f89b4f7821e5ec (diff)
downloadmeta-selinux-b59250d423e9938ae934c201922141886e279188.tar.gz
meta-selinux-b59250d423e9938ae934c201922141886e279188.tar.bz2
meta-selinux-b59250d423e9938ae934c201922141886e279188.zip
refpolicy-minimum: add fixed prepare_policy_store().
Original prepare_policy_store() has a naming bug for compressed_policy, fix that and let prepare_policy_store() back. Signed-off-by: Xin Ouyang <xin.ouyang@windriver.com>
-rw-r--r--recipes-security/refpolicy/refpolicy-minimum_2.20140311.bb28
1 files changed, 28 insertions, 0 deletions
diff --git a/recipes-security/refpolicy/refpolicy-minimum_2.20140311.bb b/recipes-security/refpolicy/refpolicy-minimum_2.20140311.bb
index 429a378..0b286ac 100644
--- a/recipes-security/refpolicy/refpolicy-minimum_2.20140311.bb
+++ b/recipes-security/refpolicy/refpolicy-minimum_2.20140311.bb
@@ -27,3 +27,31 @@ EXTRA_POLICY_MODULES += "nscd"
EXTRA_POLICY_MODULES += "mta"
POLICY_MODULES_MIN = "${CORE_POLICY_MODULES} ${EXTRA_POLICY_MODULES}"
+
+# re-write the same func from refpolicy_common.inc
+prepare_policy_store () {
+ oe_runmake 'DESTDIR=${D}' 'prefix=${D}${prefix}' install
+
+ # Prepare to create policy store
+ mkdir -p ${D}${sysconfdir}/selinux/
+ mkdir -p ${D}${sysconfdir}/selinux/${POLICY_NAME}/policy
+ mkdir -p ${D}${sysconfdir}/selinux/${POLICY_NAME}/modules/active/modules
+ mkdir -p ${D}${sysconfdir}/selinux/${POLICY_NAME}/contexts/files
+ touch ${D}${sysconfdir}/selinux/${POLICY_NAME}/contexts/files/file_contexts.local
+ if ${@base_contains('DISTRO_FEATURES','compressed_policy','true','false',d)}; then
+ for i in ${D}${datadir}/selinux/${POLICY_NAME}/*.pp; do
+ bzip2 $i
+ done
+ cp base.pp.bz2 ${D}${sysconfdir}/selinux/${POLICY_NAME}/modules/active/base.pp
+ for i in ${POLICY_MODULES_MIN}; do
+ cp ${i}.pp.bz2 ${D}${sysconfdir}/selinux/${POLICY_NAME}/modules/active/modules/`basename $i.pp`
+ done
+ else
+ bzip2 -c ${D}${datadir}/selinux/${POLICY_NAME}/base.pp > \
+ ${D}${sysconfdir}/selinux/${POLICY_NAME}/modules/active/base.pp
+ for i in ${POLICY_MODULES_MIN}; do
+ bzip2 -c ${D}${datadir}/selinux/${POLICY_NAME}/$i.pp > \
+ ${D}${sysconfdir}/selinux/${POLICY_NAME}/modules/active/modules/$i.pp
+ done
+ fi
+}