summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-08-25 20:37:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-26 11:29:45 +0100
commitf541b7388cebaceee5867825d250c568b2b1db3c (patch)
tree5cd356d9597542988ff10fc5ef4ec597c5e42b44 /meta
parent93ec1e347cbba47cb35137047ac2ef8875a1c5d1 (diff)
downloadpoky-f541b7388cebaceee5867825d250c568b2b1db3c.tar.gz
xserver-nodm-init: improvements from meta-oe
Bring in some changes from the meta-oe version of this script in order to bring them closer together. (Unfortunately it does not completely supersede the recipes in meta-oe - there is still some unification to be done between x11-common and xserver-common.) * Add systemd support (with extensions for ROOTLESS_X) * Remove sudo from RDEPENDS_${PN} since this hasn't been used by this for a long time * Rearrange recipe slightly to make the order logical A couple of additional improvements at the same time: * Use ROOT_HOME for root's home directory * Set short description in SUMMARY instead of DESCRIPTION (From OE-Core rev: d4f82500fb30e9e25b517e65c2bd72b3c2bad070) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-graphics/x11-common/xserver-nodm-init.bb38
-rw-r--r--meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf1
-rw-r--r--meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service10
3 files changed, 41 insertions, 8 deletions
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init.bb b/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
index 8490c81b48..e4508a917d 100644
--- a/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
@@ -1,30 +1,52 @@
1DESCRIPTION = "Simple Xserver Init Script (no dm)" 1SUMMARY = "Simple Xserver Init Script (no dm)"
2LICENSE = "GPLv2" 2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" 3LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
4SECTION = "x11" 4SECTION = "x11"
5PR = "r31" 5PR = "r31"
6RDEPENDS_${PN} = "sudo xuser-account"
7 6
8SRC_URI = "file://xserver-nodm \ 7SRC_URI = "file://xserver-nodm \
9 file://Xusername \ 8 file://Xusername \
10 file://gplv2-license.patch" 9 file://gplv2-license.patch \
10 file://xserver-nodm.service \
11 file://xserver-nodm.conf \
12"
11 13
12S = "${WORKDIR}" 14S = "${WORKDIR}"
13 15
16# Since we refer to ROOTLESS_X which is normally enabled per-machine
14PACKAGE_ARCH = "${MACHINE_ARCH}" 17PACKAGE_ARCH = "${MACHINE_ARCH}"
15 18
19inherit update-rc.d systemd
20
16do_install() { 21do_install() {
17 install -d ${D}${sysconfdir}
18 install -d ${D}${sysconfdir}/init.d 22 install -d ${D}${sysconfdir}/init.d
19 install xserver-nodm ${D}${sysconfdir}/init.d 23 install xserver-nodm ${D}${sysconfdir}/init.d
20 if [ "${ROOTLESS_X}" = "1" ] ; then 24
21 install -d ${D}${sysconfdir}/X11 25 if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
22 install Xusername ${D}${sysconfdir}/X11 26 install -d ${D}${sysconfdir}/default
27 install xserver-nodm.conf ${D}${sysconfdir}/default/xserver-nodm
28 install -d ${D}${systemd_unitdir}/system
29 install -m 0644 ${WORKDIR}/xserver-nodm.service ${D}${systemd_unitdir}/system
30 if [ "${ROOTLESS_X}" = "1" ] ; then
31 sed -i 's!^HOME=.*!HOME=/home/xuser!' ${D}${sysconfdir}/default/xserver-nodm
32 sed -i 's!^User=.*!User=xuser!' ${D}${systemd_unitdir}/system/xserver-nodm.service
33 else
34 sed -i 's!^HOME=.*!HOME=${ROOT_HOME}!' ${D}${sysconfdir}/default/xserver-nodm
35 sed -i '/^User=/d' ${D}${systemd_unitdir}/system/xserver-nodm.service
36 fi
37 fi
38
39 if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
40 if [ "${ROOTLESS_X}" = "1" ] ; then
41 install -d ${D}${sysconfdir}/X11
42 install Xusername ${D}${sysconfdir}/X11
43 fi
23 fi 44 fi
24} 45}
25 46
26inherit update-rc.d 47RDEPENDS_${PN} = "${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}"
27 48
28INITSCRIPT_NAME = "xserver-nodm" 49INITSCRIPT_NAME = "xserver-nodm"
29INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ." 50INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
51SYSTEMD_SERVICE_${PN} = "xserver-nodm.service"
30 52
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf
new file mode 100644
index 0000000000..3c0582a87e
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf
@@ -0,0 +1 @@
HOME=/home/root
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service
new file mode 100644
index 0000000000..62d979f1d6
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service
@@ -0,0 +1,10 @@
1[Unit]
2Description=Xserver startup without a display manager
3
4[Service]
5User=root
6EnvironmentFile=/etc/default/xserver-nodm
7ExecStart=/etc/X11/Xserver
8
9[Install]
10Alias=display-manager.service