diff options
Diffstat (limited to 'meta/recipes-graphics/x11-common/xserver-nodm-init.bb')
-rw-r--r-- | meta/recipes-graphics/x11-common/xserver-nodm-init.bb | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init.bb b/meta/recipes-graphics/x11-common/xserver-nodm-init.bb index b68d40e1be..a6d0d5eeea 100644 --- a/meta/recipes-graphics/x11-common/xserver-nodm-init.bb +++ b/meta/recipes-graphics/x11-common/xserver-nodm-init.bb | |||
@@ -5,10 +5,10 @@ SECTION = "x11" | |||
5 | PR = "r31" | 5 | PR = "r31" |
6 | 6 | ||
7 | SRC_URI = "file://xserver-nodm \ | 7 | SRC_URI = "file://xserver-nodm \ |
8 | file://Xusername \ | 8 | file://Xserver \ |
9 | file://gplv2-license.patch \ | 9 | file://gplv2-license.patch \ |
10 | file://xserver-nodm.service \ | 10 | file://xserver-nodm.service.in \ |
11 | file://xserver-nodm.conf \ | 11 | file://xserver-nodm.conf.in \ |
12 | " | 12 | " |
13 | 13 | ||
14 | S = "${WORKDIR}" | 14 | S = "${WORKDIR}" |
@@ -16,35 +16,44 @@ S = "${WORKDIR}" | |||
16 | # Since we refer to ROOTLESS_X which is normally enabled per-machine | 16 | # Since we refer to ROOTLESS_X which is normally enabled per-machine |
17 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 17 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
18 | 18 | ||
19 | inherit update-rc.d systemd | 19 | inherit update-rc.d systemd distro_features_check |
20 | |||
21 | REQUIRED_DISTRO_FEATURES = "x11" | ||
22 | |||
23 | PACKAGECONFIG ??= "blank" | ||
24 | # dpms and screen saver will be on only if 'blank' is in PACKAGECONFIG | ||
25 | PACKAGECONFIG[blank] = "" | ||
20 | 26 | ||
21 | do_install() { | 27 | do_install() { |
22 | install -d ${D}${sysconfdir}/init.d | 28 | install -d ${D}${sysconfdir}/default |
23 | install xserver-nodm ${D}${sysconfdir}/init.d | 29 | install xserver-nodm.conf.in ${D}${sysconfdir}/default/xserver-nodm |
30 | install -d ${D}${sysconfdir}/xserver-nodm | ||
31 | install Xserver ${D}${sysconfdir}/xserver-nodm/Xserver | ||
32 | |||
33 | BLANK_ARGS="${@bb.utils.contains('PACKAGECONFIG', 'blank', '', '-s 0 -dpms', d)}" | ||
34 | if [ "${ROOTLESS_X}" = "1" ] ; then | ||
35 | XUSER_HOME="/home/xuser" | ||
36 | XUSER="xuser" | ||
37 | else | ||
38 | XUSER_HOME=${ROOT_HOME} | ||
39 | XUSER="root" | ||
40 | fi | ||
41 | sed -i "s:@HOME@:${XUSER_HOME}:; s:@USER@:${XUSER}:; s:@BLANK_ARGS@:${BLANK_ARGS}:" \ | ||
42 | ${D}${sysconfdir}/default/xserver-nodm | ||
24 | 43 | ||
25 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | 44 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
26 | install -d ${D}${sysconfdir}/default | ||
27 | install xserver-nodm.conf ${D}${sysconfdir}/default/xserver-nodm | ||
28 | install -d ${D}${systemd_unitdir}/system | 45 | install -d ${D}${systemd_unitdir}/system |
29 | install -m 0644 ${WORKDIR}/xserver-nodm.service ${D}${systemd_unitdir}/system | 46 | install -m 0644 ${WORKDIR}/xserver-nodm.service.in ${D}${systemd_unitdir}/system/xserver-nodm.service |
30 | if [ "${ROOTLESS_X}" = "1" ] ; then | 47 | sed -i "s:@USER@:${XUSER}:" ${D}${systemd_unitdir}/system/xserver-nodm.service |
31 | sed -i 's!^HOME=.*!HOME=/home/xuser!' ${D}${sysconfdir}/default/xserver-nodm | ||
32 | sed -i 's!^User=.*!User=xuser!' ${D}${systemd_unitdir}/system/xserver-nodm.service | ||
33 | else | ||
34 | sed -i 's!^HOME=.*!HOME=${ROOT_HOME}!' ${D}${sysconfdir}/default/xserver-nodm | ||
35 | sed -i '/^User=/d' ${D}${systemd_unitdir}/system/xserver-nodm.service | ||
36 | fi | ||
37 | fi | 48 | fi |
38 | 49 | ||
39 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then | 50 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then |
40 | if [ "${ROOTLESS_X}" = "1" ] ; then | 51 | install -d ${D}${sysconfdir}/init.d |
41 | install -d ${D}${sysconfdir}/X11 | 52 | install xserver-nodm ${D}${sysconfdir}/init.d |
42 | install Xusername ${D}${sysconfdir}/X11 | ||
43 | fi | ||
44 | fi | 53 | fi |
45 | } | 54 | } |
46 | 55 | ||
47 | RDEPENDS_${PN} = "${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}" | 56 | RDEPENDS_${PN} = "xinit ${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}" |
48 | 57 | ||
49 | INITSCRIPT_NAME = "xserver-nodm" | 58 | INITSCRIPT_NAME = "xserver-nodm" |
50 | INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ." | 59 | INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ." |