Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Simple Xserver Init Script (no dm)" |
| 2 | LICENSE = "GPLv2" |
| 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" |
| 4 | SECTION = "x11" |
| 5 | PR = "r31" |
| 6 | |
| 7 | SRC_URI = "file://xserver-nodm \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 8 | file://Xserver \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 9 | file://gplv2-license.patch \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 10 | file://xserver-nodm.service.in \ |
| 11 | file://xserver-nodm.conf.in \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 12 | " |
| 13 | |
| 14 | S = "${WORKDIR}" |
| 15 | |
| 16 | # Since we refer to ROOTLESS_X which is normally enabled per-machine |
| 17 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 18 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 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] = "" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | |
| 27 | do_install() { |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 28 | install -d ${D}${sysconfdir}/default |
| 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 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 43 | |
| 44 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 45 | install -d ${D}${systemd_unitdir}/system |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 46 | install -m 0644 ${WORKDIR}/xserver-nodm.service.in ${D}${systemd_unitdir}/system/xserver-nodm.service |
| 47 | sed -i "s:@USER@:${XUSER}:" ${D}${systemd_unitdir}/system/xserver-nodm.service |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 48 | fi |
| 49 | |
| 50 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 51 | install -d ${D}${sysconfdir}/init.d |
| 52 | install xserver-nodm ${D}${sysconfdir}/init.d |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 53 | fi |
| 54 | } |
| 55 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 56 | RDEPENDS_${PN} = "xinit ${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 57 | |
| 58 | INITSCRIPT_NAME = "xserver-nodm" |
| 59 | INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ." |
| 60 | SYSTEMD_SERVICE_${PN} = "xserver-nodm.service" |
| 61 | |