* [PATCH 0/3] Clean up X init (oe-core vs meta-oe)
@ 2016-08-30 8:31 Jussi Kukkonen
2016-08-30 8:32 ` [PATCH 1/3] base-files: Add shell test quoting Jussi Kukkonen
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Jussi Kukkonen @ 2016-08-30 8:31 UTC (permalink / raw)
To: openembedded-core; +Cc: openembedded-devel
Goals:
* Less confusing duplication between oe-core and meta-oe
(currently just adding meta-oe to BBLAYERS completely
changes X init because meta-oe provides another version of
xserver-nodm-init)
* Make it easier to keep X init in sync between systemd and sysvinit
The xserver-nodm-init patch merges in functionality from
xserver-nodm-init-2.0 from meta-oe: The combined "Xserver" script
deprecates the ones in x11-common (oe-core) and xserver-common
(meta-oe), and should work with other parts of either x11-common
or xserver-common. In particular these differences still exist:
* Xsession files are different
* xserver-common generates X binary name and arguments at runtime
I believe the xserver-nodm-init-2.0 recipe can be removed after this
patch with one caveat: The people who assume they will get
xserver-common (meta-oe) without explicitly asking for it will be
surprised. The x11 packagegroup has "VIRTUAL-RUNTIME_xserver_common"
selection which will work but it does not seem to be commonly used.
I'd be happy to take advice on how to minimize problems from the above as
well as on how to handle the version problems: should I bump the recipe
version above 2.0?
Sorry about the timing wrt M3 freeze: This consumed much more time
than planned. We can postpone if it looks too scary at this point.
Jussi
The following changes since commit 2fedd226c3385f1ac160b3aa0bfadbded85e288c:
ref-manual: Fixed small wording in PKGR in the glossary (2016-08-25 23:09:29 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib jku/xserver-nodm
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=jku/xserver-nodm
Jussi Kukkonen (3):
base-files: Add shell test quoting
xserver-nodm-init: Deprecate /etc/X11/Xserver
x11-common: Remove Xserver script
meta/recipes-core/base-files/base-files/profile | 2 +-
.../x11-common/x11-common/Xserver.in | 12 ------
meta/recipes-graphics/x11-common/x11-common_0.1.bb | 10 +----
.../x11-common/xserver-nodm-init.bb | 47 +++++++++++++---------
.../x11-common/xserver-nodm-init/Xserver | 25 ++++++++++++
.../x11-common/xserver-nodm-init/Xusername | 1 -
.../x11-common/xserver-nodm-init/xserver-nodm | 10 +++--
.../x11-common/xserver-nodm-init/xserver-nodm.conf | 1 -
.../xserver-nodm-init/xserver-nodm.conf.in | 7 ++++
...server-nodm.service => xserver-nodm.service.in} | 4 +-
10 files changed, 69 insertions(+), 50 deletions(-)
delete mode 100644 meta/recipes-graphics/x11-common/x11-common/Xserver.in
create mode 100644 meta/recipes-graphics/x11-common/xserver-nodm-init/Xserver
delete mode 100644 meta/recipes-graphics/x11-common/xserver-nodm-init/Xusername
delete mode 100644 meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf
create mode 100644 meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in
rename meta/recipes-graphics/x11-common/xserver-nodm-init/{xserver-nodm.service => xserver-nodm.service.in} (76%)
--
2.1.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] base-files: Add shell test quoting
2016-08-30 8:31 [PATCH 0/3] Clean up X init (oe-core vs meta-oe) Jussi Kukkonen
@ 2016-08-30 8:32 ` Jussi Kukkonen
2016-08-30 8:32 ` [PATCH 2/3] xserver-nodm-init: Deprecate /etc/X11/Xserver Jussi Kukkonen
2016-08-30 8:32 ` [PATCH 3/3] x11-common: Remove Xserver script Jussi Kukkonen
2 siblings, 0 replies; 5+ messages in thread
From: Jussi Kukkonen @ 2016-08-30 8:32 UTC (permalink / raw)
To: openembedded-core; +Cc: openembedded-devel
tty can return "not a tt" which results in warnings when /etc/profile
is executed.
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
meta/recipes-core/base-files/base-files/profile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
index ba1b9ba..a52bf89 100644
--- a/meta/recipes-core/base-files/base-files/profile
+++ b/meta/recipes-core/base-files/base-files/profile
@@ -31,7 +31,7 @@ fi
if [ -x /usr/bin/resize ];then
# Make sure we are on a serial console (i.e. the device used starts with /dev/tty),
# otherwise we confuse e.g. the eclipse launcher which tries do use ssh
- test `tty | cut -c1-8` = "/dev/tty" && resize >/dev/null
+ test "`tty | cut -c1-8`" = "/dev/tty" && resize >/dev/null
fi
export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] xserver-nodm-init: Deprecate /etc/X11/Xserver
2016-08-30 8:31 [PATCH 0/3] Clean up X init (oe-core vs meta-oe) Jussi Kukkonen
2016-08-30 8:32 ` [PATCH 1/3] base-files: Add shell test quoting Jussi Kukkonen
@ 2016-08-30 8:32 ` Jussi Kukkonen
2016-09-01 6:53 ` [PATCHv2 " Jussi Kukkonen
2016-08-30 8:32 ` [PATCH 3/3] x11-common: Remove Xserver script Jussi Kukkonen
2 siblings, 1 reply; 5+ messages in thread
From: Jussi Kukkonen @ 2016-08-30 8:32 UTC (permalink / raw)
To: openembedded-core; +Cc: openembedded-devel
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>
---
.../x11-common/xserver-nodm-init.bb | 47 +++++++++++++---------
.../x11-common/xserver-nodm-init/Xserver | 25 ++++++++++++
.../x11-common/xserver-nodm-init/Xusername | 1 -
.../x11-common/xserver-nodm-init/xserver-nodm | 10 +++--
.../x11-common/xserver-nodm-init/xserver-nodm.conf | 1 -
.../xserver-nodm-init/xserver-nodm.conf.in | 7 ++++
...server-nodm.service => xserver-nodm.service.in} | 4 +-
7 files changed, 67 insertions(+), 28 deletions(-)
create mode 100644 meta/recipes-graphics/x11-common/xserver-nodm-init/Xserver
delete mode 100644 meta/recipes-graphics/x11-common/xserver-nodm-init/Xusername
delete mode 100644 meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf
create mode 100644 meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in
rename meta/recipes-graphics/x11-common/xserver-nodm-init/{xserver-nodm.service => xserver-nodm.service.in} (76%)
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init.bb b/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
index b68d40e..6057248 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 ."
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 0000000..0edbfbf
--- /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 7060e5e..0000000
--- 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 bfa0a8d..6c54855 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 3c0582a..0000000
--- 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 0000000..757c23d
--- /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
similarity index 76%
rename from meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service
rename to meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service.in
index 62d979f..324a26f 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
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] x11-common: Remove Xserver script
2016-08-30 8:31 [PATCH 0/3] Clean up X init (oe-core vs meta-oe) Jussi Kukkonen
2016-08-30 8:32 ` [PATCH 1/3] base-files: Add shell test quoting Jussi Kukkonen
2016-08-30 8:32 ` [PATCH 2/3] xserver-nodm-init: Deprecate /etc/X11/Xserver Jussi Kukkonen
@ 2016-08-30 8:32 ` Jussi Kukkonen
2 siblings, 0 replies; 5+ messages in thread
From: Jussi Kukkonen @ 2016-08-30 8:32 UTC (permalink / raw)
To: openembedded-core; +Cc: openembedded-devel
X startup is now handled in xserver-nodm-init.
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
meta/recipes-graphics/x11-common/x11-common/Xserver.in | 12 ------------
meta/recipes-graphics/x11-common/x11-common_0.1.bb | 10 +---------
2 files changed, 1 insertion(+), 21 deletions(-)
delete mode 100644 meta/recipes-graphics/x11-common/x11-common/Xserver.in
diff --git a/meta/recipes-graphics/x11-common/x11-common/Xserver.in b/meta/recipes-graphics/x11-common/x11-common/Xserver.in
deleted file mode 100644
index b8eed76..0000000
--- a/meta/recipes-graphics/x11-common/x11-common/Xserver.in
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-#
-
-XSERVER=/usr/bin/Xorg
-
-. /etc/profile
-
-ARGS=" -br -pn @BLANK_ARGS@"
-
-DISPLAY=':0'
-
-exec xinit /etc/X11/Xsession -- $XSERVER $DISPLAY $ARGS $*
diff --git a/meta/recipes-graphics/x11-common/x11-common_0.1.bb b/meta/recipes-graphics/x11-common/x11-common_0.1.bb
index 2bc0d33..ab9a939 100644
--- a/meta/recipes-graphics/x11-common/x11-common_0.1.bb
+++ b/meta/recipes-graphics/x11-common/x11-common_0.1.bb
@@ -9,22 +9,14 @@ inherit distro_features_check
REQUIRED_DISTRO_FEATURES = "x11"
SRC_URI = "file://etc \
- file://Xserver.in \
file://gplv2-license.patch"
S = "${WORKDIR}"
-PACKAGECONFIG ??= "blank"
-# dpms and screen saver will be on only if 'blank' is in PACKAGECONFIG
-PACKAGECONFIG[blank] = ""
-
do_install() {
cp -R ${S}/etc ${D}${sysconfdir}
- sed -e 's/@BLANK_ARGS@/${@bb.utils.contains('PACKAGECONFIG', 'blank', '', '-s 0 -dpms', d)}/' \
- ${S}/Xserver.in > ${D}${sysconfdir}/X11/Xserver
-
chmod -R 755 ${D}${sysconfdir}
}
-RDEPENDS_${PN} = "dbus-x11 xmodmap xdpyinfo xinput-calibrator xinit formfactor"
+RDEPENDS_${PN} = "dbus-x11 xmodmap xdpyinfo xinput-calibrator formfactor"
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCHv2 2/3] xserver-nodm-init: Deprecate /etc/X11/Xserver
2016-08-30 8:32 ` [PATCH 2/3] xserver-nodm-init: Deprecate /etc/X11/Xserver Jussi Kukkonen
@ 2016-09-01 6:53 ` Jussi Kukkonen
0 siblings, 0 replies; 5+ messages in thread
From: Jussi Kukkonen @ 2016-09-01 6:53 UTC (permalink / raw)
To: openembedded-core
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>
---
Changes since v1:
* Require distro feature x11 so 'world' can build without x11.
I've force-modified the branch at
git://git.yoctoproject.org/poky-contrib jku/xserver-nodm
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=jku/xserver-nodm
Thanks, Jussi
.../x11-common/xserver-nodm-init.bb | 51 +++++++++++++---------
.../x11-common/xserver-nodm-init/Xserver | 25 +++++++++++
.../x11-common/xserver-nodm-init/Xusername | 1 -
.../x11-common/xserver-nodm-init/xserver-nodm | 10 +++--
.../x11-common/xserver-nodm-init/xserver-nodm.conf | 1 -
.../xserver-nodm-init/xserver-nodm.conf.in | 7 +++
...server-nodm.service => xserver-nodm.service.in} | 4 +-
7 files changed, 70 insertions(+), 29 deletions(-)
create mode 100644 meta/recipes-graphics/x11-common/xserver-nodm-init/Xserver
delete mode 100644 meta/recipes-graphics/x11-common/xserver-nodm-init/Xusername
delete mode 100644 meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf
create mode 100644 meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in
rename meta/recipes-graphics/x11-common/xserver-nodm-init/{xserver-nodm.service => xserver-nodm.service.in} (76%)
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init.bb b/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
index b68d40e..a6d0d5e 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}"
@@ -16,35 +16,44 @@ S = "${WORKDIR}"
# Since we refer to ROOTLESS_X which is normally enabled per-machine
PACKAGE_ARCH = "${MACHINE_ARCH}"
-inherit update-rc.d systemd
+inherit update-rc.d systemd distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "x11"
+
+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 ."
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 0000000..0edbfbf
--- /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 7060e5e..0000000
--- 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 bfa0a8d..6c54855 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 3c0582a..0000000
--- 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 0000000..757c23d
--- /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
similarity index 76%
rename from meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service
rename to meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service.in
index 62d979f..324a26f 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
--
2.9.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-09-01 6:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-30 8:31 [PATCH 0/3] Clean up X init (oe-core vs meta-oe) Jussi Kukkonen
2016-08-30 8:32 ` [PATCH 1/3] base-files: Add shell test quoting Jussi Kukkonen
2016-08-30 8:32 ` [PATCH 2/3] xserver-nodm-init: Deprecate /etc/X11/Xserver Jussi Kukkonen
2016-09-01 6:53 ` [PATCHv2 " Jussi Kukkonen
2016-08-30 8:32 ` [PATCH 3/3] x11-common: Remove Xserver script Jussi Kukkonen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox