diff options
author | Yi Zhao <yi.zhao@windriver.com> | 2019-12-23 16:21:50 +0800 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2019-12-30 23:10:43 -0500 |
commit | 8ce3dccfda031a0a62d4e77da821436d23b09273 (patch) | |
tree | a3d94ae36201e8f8b51ade554c60ac538cb5ed91 | |
parent | 557d807edd0dc1bfe365370ef84c2827fdc3229b (diff) | |
download | meta-selinux-8ce3dccfda031a0a62d4e77da821436d23b09273.tar.gz |
selinux-initsh.inc: install selinux-init.sh and selinux-labeldev.sh when using systemd
The commit 5fd3c5b71edb99659aeb5cb5903088d84517382e introduced an issue
that selinux-init.sh and selinux-labeldev.sh are not installed when
using systemd which will cause the selinux-ini.service and
selinux-labeldev.service fail to startup. Move the do_install codes from
selinux-autorelabel to selinux-initsh.inc to make sure install these
scripts when using systemd.
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
-rw-r--r-- | recipes-security/selinux/selinux-autorelabel_0.1.bb | 3 | ||||
-rw-r--r-- | recipes-security/selinux/selinux-initsh.inc | 9 |
2 files changed, 7 insertions, 5 deletions
diff --git a/recipes-security/selinux/selinux-autorelabel_0.1.bb b/recipes-security/selinux/selinux-autorelabel_0.1.bb index 7e7d08c..b898c3b 100644 --- a/recipes-security/selinux/selinux-autorelabel_0.1.bb +++ b/recipes-security/selinux/selinux-autorelabel_0.1.bb | |||
@@ -21,9 +21,6 @@ require selinux-initsh.inc | |||
21 | 21 | ||
22 | do_install_append() { | 22 | do_install_append() { |
23 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | 23 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
24 | install -d ${D}${bindir} | ||
25 | install -m 0755 ${WORKDIR}/${SELINUX_SCRIPT_SRC}.sh ${D}${bindir} | ||
26 | sed -i -e '/.*HERE$/d' ${D}${bindir}/${SELINUX_SCRIPT_SRC}.sh | ||
27 | echo "# first boot relabelling" > ${D}/.autorelabel | 24 | echo "# first boot relabelling" > ${D}/.autorelabel |
28 | fi | 25 | fi |
29 | } | 26 | } |
diff --git a/recipes-security/selinux/selinux-initsh.inc b/recipes-security/selinux/selinux-initsh.inc index 6084762..0a6cf4b 100644 --- a/recipes-security/selinux/selinux-initsh.inc +++ b/recipes-security/selinux/selinux-initsh.inc | |||
@@ -27,8 +27,13 @@ do_install () { | |||
27 | -e '/.*HERE$/d' -e '/.*Contents.*sysvinit/d' \ | 27 | -e '/.*HERE$/d' -e '/.*Contents.*sysvinit/d' \ |
28 | ${D}${sysconfdir}/init.d/${SELINUX_SCRIPT_DST} | 28 | ${D}${sysconfdir}/init.d/${SELINUX_SCRIPT_DST} |
29 | 29 | ||
30 | install -d ${D}${systemd_unitdir}/system | 30 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
31 | install -m 0644 ${WORKDIR}/${SELINUX_SCRIPT_SRC}.service ${D}${systemd_unitdir}/system | 31 | install -d ${D}${systemd_unitdir}/system |
32 | install -m 0644 ${WORKDIR}/${SELINUX_SCRIPT_SRC}.service ${D}${systemd_unitdir}/system | ||
33 | install -d ${D}${bindir} | ||
34 | install -m 0755 ${WORKDIR}/${SELINUX_SCRIPT_SRC}.sh ${D}${bindir} | ||
35 | sed -i -e '/.*HERE$/d' ${D}${bindir}/${SELINUX_SCRIPT_SRC}.sh | ||
36 | fi | ||
32 | } | 37 | } |
33 | 38 | ||
34 | sysroot_stage_all_append () { | 39 | sysroot_stage_all_append () { |