systemd: create /var/lib/systemd/backlight in advance

v2 changes:
* Update patch for Yocto Compat - don't change layer's hash

============================================

The systemd-backlight@.service which called after selinux-init.service
will create /var/lib/systemd/backlight with incorrect security labels,
this causes the systemd-backlight service fails to start and stop.

Creating /var/lib/systemd/backlight in advance to make sure it could
always be relabelled by selinux-init while first booting.

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
This commit is contained in:
Wenzong Fan 2018-04-20 06:45:29 -04:00 committed by Joe MacDonald
parent d55fa69fa4
commit 5d203f9039
2 changed files with 8 additions and 1 deletions

View File

@ -1 +1 @@
inherit ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'enable-audit', '', d)}
require ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', '${BPN}_selinux.inc', '', d)}

View File

@ -0,0 +1,7 @@
inherit ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'enable-audit', '', d)}
do_install_append() {
if ${@bb.utils.contains('PACKAGECONFIG', 'backlight', 'true', 'false', d)}; then
install -d ${D}${localstatedir}/lib/systemd/backlight
fi
}