aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
diff options
context:
space:
mode:
authorJussi Kukkonen <jussi.kukkonen@intel.com>2016-08-30 11:32:08 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-31 08:56:49 +0100
commit40dce269a8c85fc3ab73049e904b92c79bac83d6 (patch)
tree5e22f6db19c2a1ecd1fe94ca42eec1f96ce174a7 /meta/recipes-graphics/x11-common/xserver-nodm-init.bb
parent3d56c859c5082b2314f229f5ae82f290d6e8c669 (diff)
downloadopenembedded-core-contrib-40dce269a8c85fc3ab73049e904b92c79bac83d6.tar.gz
xserver-nodm-init: Deprecate /etc/X11/Xserver
This commit should provide the same functionality as before, but should make meta-oe xserver-nodm-init-2.0 obsolete as well as keep systemd and sysvinit startup better in sync. /etc/X11/Xserver is not called anymore: it is provided by both x11-common and xserver-common with no useful differences (but some annoying ones). Instead xserver-nodm-init provides /etc/xserver-nodm/Xserver as the startup script and /etc/default/xserver-nodm as the default settings file. These are used by both init systems. The Xserver script could be completely removed (with sysv and systemd calling xinit directly), but to keep compatibility with meta-oes xserver-nodm-init-2.0 the Xserver script sources /etc/X11/xserver-common if one exists -- and systemd EnvironmentFile cannot do that. x11-common used to have a packageconfig to easily control screen blanking. Move this to xserver-nodm-init. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics/x11-common/xserver-nodm-init.bb')
-rw-r--r--meta/recipes-graphics/x11-common/xserver-nodm-init.bb47
1 files changed, 27 insertions, 20 deletions
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init.bb b/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
index b68d40e1be..6057248a6c 100644
--- a/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
@@ -5,10 +5,10 @@ SECTION = "x11"
PR = "r31"
SRC_URI = "file://xserver-nodm \
- file://Xusername \
+ file://Xserver \
file://gplv2-license.patch \
- file://xserver-nodm.service \
- file://xserver-nodm.conf \
+ file://xserver-nodm.service.in \
+ file://xserver-nodm.conf.in \
"
S = "${WORKDIR}"
@@ -18,33 +18,40 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
inherit update-rc.d systemd
+PACKAGECONFIG ??= "blank"
+# dpms and screen saver will be on only if 'blank' is in PACKAGECONFIG
+PACKAGECONFIG[blank] = ""
+
do_install() {
- install -d ${D}${sysconfdir}/init.d
- install xserver-nodm ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir}/default
+ install xserver-nodm.conf.in ${D}${sysconfdir}/default/xserver-nodm
+ install -d ${D}${sysconfdir}/xserver-nodm
+ install Xserver ${D}${sysconfdir}/xserver-nodm/Xserver
+
+ BLANK_ARGS="${@bb.utils.contains('PACKAGECONFIG', 'blank', '', '-s 0 -dpms', d)}"
+ if [ "${ROOTLESS_X}" = "1" ] ; then
+ XUSER_HOME="/home/xuser"
+ XUSER="xuser"
+ else
+ XUSER_HOME=${ROOT_HOME}
+ XUSER="root"
+ fi
+ sed -i "s:@HOME@:${XUSER_HOME}:; s:@USER@:${XUSER}:; s:@BLANK_ARGS@:${BLANK_ARGS}:" \
+ ${D}${sysconfdir}/default/xserver-nodm
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
- install -d ${D}${sysconfdir}/default
- install xserver-nodm.conf ${D}${sysconfdir}/default/xserver-nodm
install -d ${D}${systemd_unitdir}/system
- install -m 0644 ${WORKDIR}/xserver-nodm.service ${D}${systemd_unitdir}/system
- if [ "${ROOTLESS_X}" = "1" ] ; then
- sed -i 's!^HOME=.*!HOME=/home/xuser!' ${D}${sysconfdir}/default/xserver-nodm
- sed -i 's!^User=.*!User=xuser!' ${D}${systemd_unitdir}/system/xserver-nodm.service
- else
- sed -i 's!^HOME=.*!HOME=${ROOT_HOME}!' ${D}${sysconfdir}/default/xserver-nodm
- sed -i '/^User=/d' ${D}${systemd_unitdir}/system/xserver-nodm.service
- fi
+ install -m 0644 ${WORKDIR}/xserver-nodm.service.in ${D}${systemd_unitdir}/system/xserver-nodm.service
+ sed -i "s:@USER@:${XUSER}:" ${D}${systemd_unitdir}/system/xserver-nodm.service
fi
if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
- if [ "${ROOTLESS_X}" = "1" ] ; then
- install -d ${D}${sysconfdir}/X11
- install Xusername ${D}${sysconfdir}/X11
- fi
+ install -d ${D}${sysconfdir}/init.d
+ install xserver-nodm ${D}${sysconfdir}/init.d
fi
}
-RDEPENDS_${PN} = "${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}"
+RDEPENDS_${PN} = "xinit ${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}"
INITSCRIPT_NAME = "xserver-nodm"
INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ."