blob: 385fea5e8399ea6ade8485e96a95461c0e28a338 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001SUMMARY = "Simple Xserver Init Script (no dm)"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
4SECTION = "x11"
5PR = "r31"
6
7SRC_URI = "file://xserver-nodm \
8 file://Xserver \
9 file://X11 \
10 file://gplv2-license.patch \
11 file://xserver-nodm.service.in \
12 file://xserver-nodm.conf.in \
13"
14
15S = "${WORKDIR}"
16
17# Since we refer to ROOTLESS_X which is normally enabled per-machine
18PACKAGE_ARCH = "${MACHINE_ARCH}"
19
Brad Bishop6dbb3162019-11-25 09:41:34 -050020inherit update-rc.d systemd features_check
Brad Bishop6e60e8b2018-02-01 10:27:11 -050021
22REQUIRED_DISTRO_FEATURES = "x11"
23
24PACKAGECONFIG ??= "blank"
25# dpms and screen saver will be on only if 'blank' is in PACKAGECONFIG
26PACKAGECONFIG[blank] = ""
27PACKAGECONFIG[nocursor] = ""
28
29do_install() {
30 install -d ${D}${sysconfdir}/default
31 install xserver-nodm.conf.in ${D}${sysconfdir}/default/xserver-nodm
32 install -d ${D}${sysconfdir}/xserver-nodm
33 install Xserver ${D}${sysconfdir}/xserver-nodm/Xserver
34 install -d ${D}${sysconfdir}/X11/Xsession.d
35 install X11/Xsession.d/* ${D}${sysconfdir}/X11/Xsession.d/
36 install X11/Xsession ${D}${sysconfdir}/X11/
37
38 BLANK_ARGS="${@bb.utils.contains('PACKAGECONFIG', 'blank', '', '-s 0 -dpms', d)}"
39 NO_CURSOR_ARG="${@bb.utils.contains('PACKAGECONFIG', 'nocursor', '-nocursor', '', d)}"
40 if [ "${ROOTLESS_X}" = "1" ] ; then
41 XUSER_HOME="/home/xuser"
42 XUSER="xuser"
43 else
44 XUSER_HOME=${ROOT_HOME}
45 XUSER="root"
46 fi
47 sed -i "s:@HOME@:${XUSER_HOME}:; s:@USER@:${XUSER}:; s:@BLANK_ARGS@:${BLANK_ARGS}:" \
48 ${D}${sysconfdir}/default/xserver-nodm
49 sed -i "s:@NO_CURSOR_ARG@:${NO_CURSOR_ARG}:" ${D}${sysconfdir}/default/xserver-nodm
50
51 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
52 install -d ${D}${systemd_unitdir}/system
53 install -m 0644 ${WORKDIR}/xserver-nodm.service.in ${D}${systemd_unitdir}/system/xserver-nodm.service
54 sed -i "s:@USER@:${XUSER}:" ${D}${systemd_unitdir}/system/xserver-nodm.service
55 fi
56
57 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
58 install -d ${D}${sysconfdir}/init.d
59 install xserver-nodm ${D}${sysconfdir}/init.d
60 fi
61}
62
Brad Bishop316dfdd2018-06-25 12:45:53 -040063RDEPENDS_${PN} = "xinit ${@oe.utils.conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050064
65INITSCRIPT_NAME = "xserver-nodm"
66INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ."
67SYSTEMD_SERVICE_${PN} = "xserver-nodm.service"
68
69RCONFLICTS_${PN} = "xserver-common (< 1.34-r9) x11-common"