blob: 3f20ad4fc744614565524942cfff122afad46ee1 [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 \
Andrew Geissler82c905d2020-04-13 13:39:40 -050013 file://capability.conf \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050014"
15
16S = "${WORKDIR}"
17
18# Since we refer to ROOTLESS_X which is normally enabled per-machine
19PACKAGE_ARCH = "${MACHINE_ARCH}"
20
Brad Bishop6dbb3162019-11-25 09:41:34 -050021inherit update-rc.d systemd features_check
Brad Bishop6e60e8b2018-02-01 10:27:11 -050022
Andrew Geissler82c905d2020-04-13 13:39:40 -050023REQUIRED_DISTRO_FEATURES = "x11 ${@oe.utils.conditional('ROOTLESS_X', '1', 'pam', '', d)}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050024
25PACKAGECONFIG ??= "blank"
26# dpms and screen saver will be on only if 'blank' is in PACKAGECONFIG
27PACKAGECONFIG[blank] = ""
28PACKAGECONFIG[nocursor] = ""
29
30do_install() {
31 install -d ${D}${sysconfdir}/default
32 install xserver-nodm.conf.in ${D}${sysconfdir}/default/xserver-nodm
33 install -d ${D}${sysconfdir}/xserver-nodm
34 install Xserver ${D}${sysconfdir}/xserver-nodm/Xserver
35 install -d ${D}${sysconfdir}/X11/Xsession.d
36 install X11/Xsession.d/* ${D}${sysconfdir}/X11/Xsession.d/
37 install X11/Xsession ${D}${sysconfdir}/X11/
38
39 BLANK_ARGS="${@bb.utils.contains('PACKAGECONFIG', 'blank', '', '-s 0 -dpms', d)}"
40 NO_CURSOR_ARG="${@bb.utils.contains('PACKAGECONFIG', 'nocursor', '-nocursor', '', d)}"
41 if [ "${ROOTLESS_X}" = "1" ] ; then
42 XUSER_HOME="/home/xuser"
43 XUSER="xuser"
Andrew Geissler82c905d2020-04-13 13:39:40 -050044 install -D capability.conf ${D}${sysconfdir}/security/capability.conf
45 sed -i "s:@USER@:${XUSER}:" ${D}${sysconfdir}/security/capability.conf
Brad Bishop6e60e8b2018-02-01 10:27:11 -050046 else
47 XUSER_HOME=${ROOT_HOME}
48 XUSER="root"
49 fi
50 sed -i "s:@HOME@:${XUSER_HOME}:; s:@USER@:${XUSER}:; s:@BLANK_ARGS@:${BLANK_ARGS}:" \
51 ${D}${sysconfdir}/default/xserver-nodm
52 sed -i "s:@NO_CURSOR_ARG@:${NO_CURSOR_ARG}:" ${D}${sysconfdir}/default/xserver-nodm
53
54 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
55 install -d ${D}${systemd_unitdir}/system
56 install -m 0644 ${WORKDIR}/xserver-nodm.service.in ${D}${systemd_unitdir}/system/xserver-nodm.service
57 sed -i "s:@USER@:${XUSER}:" ${D}${systemd_unitdir}/system/xserver-nodm.service
58 fi
59
60 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
61 install -d ${D}${sysconfdir}/init.d
62 install xserver-nodm ${D}${sysconfdir}/init.d
63 fi
64}
65
Patrick Williams213cb262021-08-07 19:21:33 -050066RDEPENDS:${PN} = "xinit ${@oe.utils.conditional('ROOTLESS_X', '1', 'xuser-account libcap libcap-bin', '', d)}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050067
68INITSCRIPT_NAME = "xserver-nodm"
69INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ."
Patrick Williams213cb262021-08-07 19:21:33 -050070SYSTEMD_SERVICE:${PN} = "xserver-nodm.service"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050071
Patrick Williams213cb262021-08-07 19:21:33 -050072RCONFLICTS:${PN} = "xserver-common (< 1.34-r9) x11-common"