Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | SUMMARY = "Simple Xserver Init Script (no dm)" |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame^] | 2 | LICENSE = "GPL-2.0-only" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" |
| 4 | SECTION = "x11" |
| 5 | PR = "r31" |
| 6 | |
| 7 | SRC_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 Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 13 | file://capability.conf \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 14 | " |
| 15 | |
| 16 | S = "${WORKDIR}" |
| 17 | |
| 18 | # Since we refer to ROOTLESS_X which is normally enabled per-machine |
| 19 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 20 | |
Brad Bishop | 6dbb316 | 2019-11-25 09:41:34 -0500 | [diff] [blame] | 21 | inherit update-rc.d systemd features_check |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 22 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 23 | REQUIRED_DISTRO_FEATURES = "x11 ${@oe.utils.conditional('ROOTLESS_X', '1', 'pam', '', d)}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 24 | |
| 25 | PACKAGECONFIG ??= "blank" |
| 26 | # dpms and screen saver will be on only if 'blank' is in PACKAGECONFIG |
| 27 | PACKAGECONFIG[blank] = "" |
| 28 | PACKAGECONFIG[nocursor] = "" |
| 29 | |
| 30 | do_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 Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 44 | install -D capability.conf ${D}${sysconfdir}/security/capability.conf |
| 45 | sed -i "s:@USER@:${XUSER}:" ${D}${sysconfdir}/security/capability.conf |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 46 | 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 |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 55 | install -d ${D}${systemd_system_unitdir} |
| 56 | install -m 0644 ${WORKDIR}/xserver-nodm.service.in ${D}${systemd_system_unitdir}/xserver-nodm.service |
| 57 | sed -i "s:@USER@:${XUSER}:" ${D}${systemd_system_unitdir}/xserver-nodm.service |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 66 | RDEPENDS:${PN} = "xinit ${@oe.utils.conditional('ROOTLESS_X', '1', 'xuser-account libcap libcap-bin', '', d)}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 67 | |
| 68 | INITSCRIPT_NAME = "xserver-nodm" |
| 69 | INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ." |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 70 | SYSTEMD_SERVICE:${PN} = "xserver-nodm.service" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 71 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 72 | RCONFLICTS:${PN} = "xserver-common (< 1.34-r9) x11-common" |