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-08 08:25:18 +0100 |
commit | e8ce3d2626e505924a75de96650abca166fd230a (patch) | |
tree | c87ca7f378b1654c0ebca2fc82d35b552f7f0c1b /meta/recipes-graphics/x11-common/xserver-nodm-init | |
parent | 8296e258b36a6238605e068e13c1982b1d12fe53 (diff) | |
download | openembedded-core-e8ce3d2626e505924a75de96650abca166fd230a.tar.gz openembedded-core-e8ce3d2626e505924a75de96650abca166fd230a.tar.bz2 openembedded-core-e8ce3d2626e505924a75de96650abca166fd230a.zip |
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')
-rw-r--r-- | meta/recipes-graphics/x11-common/xserver-nodm-init/Xserver | 25 | ||||
-rw-r--r-- | meta/recipes-graphics/x11-common/xserver-nodm-init/Xusername | 1 | ||||
-rwxr-xr-x | meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm | 10 | ||||
-rw-r--r-- | meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf | 1 | ||||
-rw-r--r-- | meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in | 7 | ||||
-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 |
6 files changed, 40 insertions, 8 deletions
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 @@ +#!/bin/sh + +# This script is only needed to make sure /etc/X11/xserver-common +# can affect XSERVER, ARGS & DPI: otherwise systemd could just use +# /etc/default/xserver-nodm as EnvironmentFile and sysvinit could just +# source the same file + +. /etc/profile + +# load default values for XSERVER, ARGS, DISPLAY... +. /etc/default/xserver-nodm + +# Allow xserver-common to override ARGS, XSERVER, DPI +if [ -e /etc/X11/xserver-common ] ; then + . /etc/X11/xserver-common + if [ ! -e $XSERVER ] ; then + XSERVER=$(which $XSERVER) + fi +fi + +if [ -n "$DPI" ] ; then + ARGS="$ARGS -dpi $DPI" +fi + +exec 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 @@ -xuser 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 case "$1" in start) . /etc/profile - username=root + + #default for USER + . /etc/default/xserver-nodm echo "Starting Xserver" - if [ -f /etc/X11/Xusername ]; then - username=`cat /etc/X11/Xusername` + if [ "$USER" != "root" ]; then # setting for rootless X chmod o+w /var/log chmod g+r /dev/tty[0-3] @@ -38,8 +39,9 @@ case "$1" in chmod o+rw /dev/hidraw* fi fi + # Using su rather than sudo as latest 1.8.1 cause failure [YOCTO #1211] - su -l -c '/etc/X11/Xserver&' $username + su -l -c '/etc/xserver-nodm/Xserver &' $USER # Wait for the desktop to say its finished loading # before loading the rest of the system # 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 @@ -HOME=/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 @@ +# common environment file for sysvinit and systemd + +XSERVER=/usr/bin/Xorg +DISPLAY=:0 +ARGS=" -br -pn @BLANK_ARGS@ " +HOME=@HOME@ +USER=@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 @@ Description=Xserver startup without a display manager [Service] -User=root EnvironmentFile=/etc/default/xserver-nodm -ExecStart=/etc/X11/Xserver +User=@USER@ +ExecStart=/etc/xserver-nodm/Xserver [Install] Alias=display-manager.service |