summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb
diff options
context:
space:
mode:
authorKevin Hao <kexin.hao@windriver.com>2020-02-08 20:36:42 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-07 10:56:45 +0000
commit0dffb9470991e497025a50347f1719461e6398f3 (patch)
tree10a8304ff71d85a9198c8531d27c93957f783ddb /meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb
parentb61d8bc577cd76eb506d15a2c4c4e9016f0c20c5 (diff)
downloadpoky-0dffb9470991e497025a50347f1719461e6398f3.tar.gz
xserver-nodm-init: Fix the start failure for non-root user
In order to start the xserver, a non-root user should have the cap_sys_admin capability to set the drm master. We try to get the cap_sys_admin capability by setting it in both the thread and file inheritable set. The side effect of this is that we would have to add the "pam" to the distro features if we want use the xserver-nodm-init for a non-root user. [Yocto #11526] (From OE-Core rev: fec05cd1eaaad41fd72a29d7792f1c37d2a82f3e) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit cfd71a68a4931c8bda15357ebb1e9ebcf0e302dc) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb')
-rw-r--r--meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb7
1 files changed, 5 insertions, 2 deletions
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb b/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb
index a77c56445c..7f4e1e29f1 100644
--- a/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb
@@ -10,6 +10,7 @@ SRC_URI = "file://xserver-nodm \
10 file://gplv2-license.patch \ 10 file://gplv2-license.patch \
11 file://xserver-nodm.service.in \ 11 file://xserver-nodm.service.in \
12 file://xserver-nodm.conf.in \ 12 file://xserver-nodm.conf.in \
13 file://capability.conf \
13" 14"
14 15
15S = "${WORKDIR}" 16S = "${WORKDIR}"
@@ -19,7 +20,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
19 20
20inherit update-rc.d systemd distro_features_check 21inherit update-rc.d systemd distro_features_check
21 22
22REQUIRED_DISTRO_FEATURES = "x11" 23REQUIRED_DISTRO_FEATURES = "x11 ${@oe.utils.conditional('ROOTLESS_X', '1', 'pam', '', d)}"
23 24
24PACKAGECONFIG ??= "blank" 25PACKAGECONFIG ??= "blank"
25# dpms and screen saver will be on only if 'blank' is in PACKAGECONFIG 26# dpms and screen saver will be on only if 'blank' is in PACKAGECONFIG
@@ -40,6 +41,8 @@ do_install() {
40 if [ "${ROOTLESS_X}" = "1" ] ; then 41 if [ "${ROOTLESS_X}" = "1" ] ; then
41 XUSER_HOME="/home/xuser" 42 XUSER_HOME="/home/xuser"
42 XUSER="xuser" 43 XUSER="xuser"
44 install -D capability.conf ${D}${sysconfdir}/security/capability.conf
45 sed -i "s:@USER@:${XUSER}:" ${D}${sysconfdir}/security/capability.conf
43 else 46 else
44 XUSER_HOME=${ROOT_HOME} 47 XUSER_HOME=${ROOT_HOME}
45 XUSER="root" 48 XUSER="root"
@@ -60,7 +63,7 @@ do_install() {
60 fi 63 fi
61} 64}
62 65
63RDEPENDS_${PN} = "xinit ${@oe.utils.conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}" 66RDEPENDS_${PN} = "xinit ${@oe.utils.conditional('ROOTLESS_X', '1', 'xuser-account libcap libcap-bin', '', d)}"
64 67
65INITSCRIPT_NAME = "xserver-nodm" 68INITSCRIPT_NAME = "xserver-nodm"
66INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ." 69INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ."