[yocto] [meta-security][PATCH 2/2] Fix build issue for apparmor when systemd is used

Jinliang Li jinliang.li at linux.alibaba.com
Wed Jun 6 07:06:53 PDT 2018


When systemd is used as system init manager, there is a build issue complains
"can't found apparmor.service". This patch fix it.

Signed-off-by: Jinliang Li <jinliang.li at linux.alibaba.com>
---
 recipes-security/AppArmor/apparmor_2.11.0.bb | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/recipes-security/AppArmor/apparmor_2.11.0.bb b/recipes-security/AppArmor/apparmor_2.11.0.bb
index a83c2c3..fc9b614 100644
--- a/recipes-security/AppArmor/apparmor_2.11.0.bb
+++ b/recipes-security/AppArmor/apparmor_2.11.0.bb
@@ -104,6 +104,11 @@ do_install () {
 
 	install ${WORKDIR}/apparmor ${D}/${INIT_D_DIR}/apparmor
 	install ${WORKDIR}/functions ${D}/lib/apparmor
+	if [ "${VIRTUAL-RUNTIME_init_manager}" = "systemd" ]; then
+		install -d ${D}${systemd_system_unitdir}
+		install ${WORKDIR}/apparmor.service \
+			${D}${systemd_system_unitdir}
+	fi
 }
 
 do_compile_ptest () {
-- 
2.7.4



More information about the yocto mailing list