summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJussi Kukkonen <jussi.kukkonen@intel.com>2016-09-01 09:53:04 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-09 11:53:36 +0100
commit3b7cdffebd12da9646f43573d989c9a76476241f (patch)
treeccb241a7b2c7974b8c42dcb31dc9b8a3009f978a
parent37f4b39d0e9809f06ac8f010a347b323857a5a0f (diff)
downloadpoky-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>
-rw-r--r--meta/recipes-graphics/x11-common/xserver-nodm-init.bb51
-rw-r--r--meta/recipes-graphics/x11-common/xserver-nodm-init/Xserver25
-rw-r--r--meta/recipes-graphics/x11-common/xserver-nodm-init/Xusername1
-rwxr-xr-xmeta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm10
-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.conf.in7
-rw-r--r--meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service.in (renamed from meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service)4
7 files changed, 70 insertions, 29 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"
5PR = "r31" 5PR = "r31"
6 6
7SRC_URI = "file://xserver-nodm \ 7SRC_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
14S = "${WORKDIR}" 14S = "${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
17PACKAGE_ARCH = "${MACHINE_ARCH}" 17PACKAGE_ARCH = "${MACHINE_ARCH}"
18 18
19inherit update-rc.d systemd 19inherit update-rc.d systemd distro_features_check
20
21REQUIRED_DISTRO_FEATURES = "x11"
22
23PACKAGECONFIG ??= "blank"
24# dpms and screen saver will be on only if 'blank' is in PACKAGECONFIG
25PACKAGECONFIG[blank] = ""
20 26
21do_install() { 27do_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
47RDEPENDS_${PN} = "${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}" 56RDEPENDS_${PN} = "xinit ${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}"
48 57
49INITSCRIPT_NAME = "xserver-nodm" 58INITSCRIPT_NAME = "xserver-nodm"
50INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ." 59INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ."
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init/Xserver b/meta/recipes-graphics/x11-common/xserver-nodm-init/Xserver
new file mode 100644
index 0000000000..0edbfbfc20
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init/Xserver
@@ -0,0 +1,25 @@
1#!/bin/sh
2
3# This script is only needed to make sure /etc/X11/xserver-common
4# can affect XSERVER, ARGS & DPI: otherwise systemd could just use
5# /etc/default/xserver-nodm as EnvironmentFile and sysvinit could just
6# source the same file
7
8. /etc/profile
9
10# load default values for XSERVER, ARGS, DISPLAY...
11. /etc/default/xserver-nodm
12
13# Allow xserver-common to override ARGS, XSERVER, DPI
14if [ -e /etc/X11/xserver-common ] ; then
15 . /etc/X11/xserver-common
16 if [ ! -e $XSERVER ] ; then
17 XSERVER=$(which $XSERVER)
18 fi
19fi
20
21if [ -n "$DPI" ] ; then
22 ARGS="$ARGS -dpi $DPI"
23fi
24
25exec xinit /etc/X11/Xsession -- $XSERVER $DISPLAY $ARGS $*
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init/Xusername b/meta/recipes-graphics/x11-common/xserver-nodm-init/Xusername
deleted file mode 100644
index 7060e5ec16..0000000000
--- a/meta/recipes-graphics/x11-common/xserver-nodm-init/Xusername
+++ /dev/null
@@ -1 +0,0 @@
1xuser
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm
index bfa0a8d6cb..6c548551b8 100755
--- a/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm
@@ -26,10 +26,11 @@ done
26case "$1" in 26case "$1" in
27 start) 27 start)
28 . /etc/profile 28 . /etc/profile
29 username=root 29
30 #default for USER
31 . /etc/default/xserver-nodm
30 echo "Starting Xserver" 32 echo "Starting Xserver"
31 if [ -f /etc/X11/Xusername ]; then 33 if [ "$USER" != "root" ]; then
32 username=`cat /etc/X11/Xusername`
33 # setting for rootless X 34 # setting for rootless X
34 chmod o+w /var/log 35 chmod o+w /var/log
35 chmod g+r /dev/tty[0-3] 36 chmod g+r /dev/tty[0-3]
@@ -38,8 +39,9 @@ case "$1" in
38 chmod o+rw /dev/hidraw* 39 chmod o+rw /dev/hidraw*
39 fi 40 fi
40 fi 41 fi
42
41 # Using su rather than sudo as latest 1.8.1 cause failure [YOCTO #1211] 43 # Using su rather than sudo as latest 1.8.1 cause failure [YOCTO #1211]
42 su -l -c '/etc/X11/Xserver&' $username 44 su -l -c '/etc/xserver-nodm/Xserver &' $USER
43 # Wait for the desktop to say its finished loading 45 # Wait for the desktop to say its finished loading
44 # before loading the rest of the system 46 # before loading the rest of the system
45 # dbus-wait org.matchbox_project.desktop Loaded 47 # dbus-wait org.matchbox_project.desktop Loaded
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
deleted file mode 100644
index 3c0582a87e..0000000000
--- a/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf
+++ /dev/null
@@ -1 +0,0 @@
1HOME=/home/root
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in
new file mode 100644
index 0000000000..757c23d95a
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in
@@ -0,0 +1,7 @@
1# common environment file for sysvinit and systemd
2
3XSERVER=/usr/bin/Xorg
4DISPLAY=:0
5ARGS=" -br -pn @BLANK_ARGS@ "
6HOME=@HOME@
7USER=@USER@
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.in
index 62d979f1d6..324a26f549 100644
--- a/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service.in
@@ -2,9 +2,9 @@
2Description=Xserver startup without a display manager 2Description=Xserver startup without a display manager
3 3
4[Service] 4[Service]
5User=root
6EnvironmentFile=/etc/default/xserver-nodm 5EnvironmentFile=/etc/default/xserver-nodm
7ExecStart=/etc/X11/Xserver 6User=@USER@
7ExecStart=/etc/xserver-nodm/Xserver
8 8
9[Install] 9[Install]
10Alias=display-manager.service 10Alias=display-manager.service