diff options
author | Jussi Kukkonen <jussi.kukkonen@intel.com> | 2016-09-01 09:53:04 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-09 11:53:36 +0100 |
commit | 3b7cdffebd12da9646f43573d989c9a76476241f (patch) | |
tree | ccb241a7b2c7974b8c42dcb31dc9b8a3009f978a /meta/recipes-graphics/x11-common/xserver-nodm-init.bb | |
parent | 37f4b39d0e9809f06ac8f010a347b323857a5a0f (diff) | |
download | poky-3b7cdffebd12da9646f43573d989c9a76476241f.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.
(From OE-Core rev: e8ce3d2626e505924a75de96650abca166fd230a)
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.bb | 51 |
1 files changed, 30 insertions, 21 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..a6d0d5eeea 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" | |||
5 | PR = "r31" | 5 | PR = "r31" |
6 | 6 | ||
7 | SRC_URI = "file://xserver-nodm \ | 7 | SRC_URI = "file://xserver-nodm \ |
8 | file://Xusername \ | 8 | file://Xserver \ |
9 | file://gplv2-license.patch \ | 9 | file://gplv2-license.patch \ |
10 | file://xserver-nodm.service \ | 10 | file://xserver-nodm.service.in \ |
11 | file://xserver-nodm.conf \ | 11 | file://xserver-nodm.conf.in \ |
12 | " | 12 | " |
13 | 13 | ||
14 | S = "${WORKDIR}" | 14 | S = "${WORKDIR}" |
@@ -16,35 +16,44 @@ S = "${WORKDIR}" | |||
16 | # Since we refer to ROOTLESS_X which is normally enabled per-machine | 16 | # Since we refer to ROOTLESS_X which is normally enabled per-machine |
17 | PACKAGE_ARCH = "${MACHINE_ARCH}" | 17 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
18 | 18 | ||
19 | inherit update-rc.d systemd | 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] = "" | ||
20 | 26 | ||
21 | do_install() { | 27 | do_install() { |
22 | install -d ${D}${sysconfdir}/init.d | 28 | install -d ${D}${sysconfdir}/default |
23 | install xserver-nodm ${D}${sysconfdir}/init.d | 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 | ||
24 | 43 | ||
25 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | 44 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
26 | install -d ${D}${sysconfdir}/default | ||
27 | install xserver-nodm.conf ${D}${sysconfdir}/default/xserver-nodm | ||
28 | install -d ${D}${systemd_unitdir}/system | 45 | install -d ${D}${systemd_unitdir}/system |
29 | install -m 0644 ${WORKDIR}/xserver-nodm.service ${D}${systemd_unitdir}/system | 46 | install -m 0644 ${WORKDIR}/xserver-nodm.service.in ${D}${systemd_unitdir}/system/xserver-nodm.service |
30 | if [ "${ROOTLESS_X}" = "1" ] ; then | 47 | sed -i "s:@USER@:${XUSER}:" ${D}${systemd_unitdir}/system/xserver-nodm.service |
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 | 48 | fi |
38 | 49 | ||
39 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then | 50 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then |
40 | if [ "${ROOTLESS_X}" = "1" ] ; then | 51 | install -d ${D}${sysconfdir}/init.d |
41 | install -d ${D}${sysconfdir}/X11 | 52 | install xserver-nodm ${D}${sysconfdir}/init.d |
42 | install Xusername ${D}${sysconfdir}/X11 | ||
43 | fi | ||
44 | fi | 53 | fi |
45 | } | 54 | } |
46 | 55 | ||
47 | RDEPENDS_${PN} = "${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}" | 56 | RDEPENDS_${PN} = "xinit ${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}" |
48 | 57 | ||
49 | INITSCRIPT_NAME = "xserver-nodm" | 58 | INITSCRIPT_NAME = "xserver-nodm" |
50 | INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ." | 59 | INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ." |