blob: 671c0a290e8ff68b295126d239797320f6e8c0a8 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001SUMMARY = "Simple Xserver Init Script (no dm)"
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00002LICENSE = "GPL-2.0-only"
Brad Bishop6e60e8b2018-02-01 10:27:11 -05003LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
4SECTION = "x11"
Brad Bishop6e60e8b2018-02-01 10:27:11 -05005
6SRC_URI = "file://xserver-nodm \
7 file://Xserver \
8 file://X11 \
9 file://gplv2-license.patch \
10 file://xserver-nodm.service.in \
11 file://xserver-nodm.conf.in \
Andrew Geissler82c905d2020-04-13 13:39:40 -050012 file://capability.conf \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050013"
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
Andrew Geissler82c905d2020-04-13 13:39:40 -050022REQUIRED_DISTRO_FEATURES = "x11 ${@oe.utils.conditional('ROOTLESS_X', '1', 'pam', '', d)}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050023
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"
Andrew Geissler82c905d2020-04-13 13:39:40 -050043 install -D capability.conf ${D}${sysconfdir}/security/capability.conf
44 sed -i "s:@USER@:${XUSER}:" ${D}${sysconfdir}/security/capability.conf
Brad Bishop6e60e8b2018-02-01 10:27:11 -050045 else
46 XUSER_HOME=${ROOT_HOME}
47 XUSER="root"
48 fi
49 sed -i "s:@HOME@:${XUSER_HOME}:; s:@USER@:${XUSER}:; s:@BLANK_ARGS@:${BLANK_ARGS}:" \
50 ${D}${sysconfdir}/default/xserver-nodm
51 sed -i "s:@NO_CURSOR_ARG@:${NO_CURSOR_ARG}:" ${D}${sysconfdir}/default/xserver-nodm
52
53 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
Andrew Geissler5199d832021-09-24 16:47:35 -050054 install -d ${D}${systemd_system_unitdir}
55 install -m 0644 ${WORKDIR}/xserver-nodm.service.in ${D}${systemd_system_unitdir}/xserver-nodm.service
56 sed -i "s:@USER@:${XUSER}:" ${D}${systemd_system_unitdir}/xserver-nodm.service
Brad Bishop6e60e8b2018-02-01 10:27:11 -050057 fi
58
59 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
60 install -d ${D}${sysconfdir}/init.d
61 install xserver-nodm ${D}${sysconfdir}/init.d
62 fi
63}
64
Patrick Williams213cb262021-08-07 19:21:33 -050065RDEPENDS:${PN} = "xinit ${@oe.utils.conditional('ROOTLESS_X', '1', 'xuser-account libcap libcap-bin', '', d)}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050066
67INITSCRIPT_NAME = "xserver-nodm"
68INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ."
Patrick Williams213cb262021-08-07 19:21:33 -050069SYSTEMD_SERVICE:${PN} = "xserver-nodm.service"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050070
Patrick Williams213cb262021-08-07 19:21:33 -050071RCONFLICTS:${PN} = "xserver-common (< 1.34-r9) x11-common"