From 3a62855de4c91ae0f4410cc8becc6df214c7b1fc Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Mon, 24 Jan 2022 16:34:09 +0100 Subject: [PATCH] weston-init: restore profile script to previous implementation This is a partial revert of commit 3819ee66726ea9606755495662efc2184ec764c2. NXP simplified the profile script when updating to hardknott-5.10.72-2.2.0, but since the /run/user/0 directory isn't automatically created in sysvinit environments, the weston desktop fails to start in these cases. The previous version of the script automatically creates said directory if it's missing, so use that version instead. Signed-off-by: Gabriel Valcazar --- .../recipes-graphics/wayland/weston-init/profile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/meta-digi-dey/recipes-graphics/wayland/weston-init/profile b/meta-digi-dey/recipes-graphics/wayland/weston-init/profile index 078599f42..6183a7d55 100644 --- a/meta-digi-dey/recipes-graphics/wayland/weston-init/profile +++ b/meta-digi-dey/recipes-graphics/wayland/weston-init/profile @@ -1,9 +1,15 @@ #!/bin/sh -# Set XDG_RUNTIME_DIR manually. -# The variable is not set for ssh login, causing app failures. It's not clear -# if this is an error or by design, but setting it manually does help and -# doesn't seem to hurt... +# Digi: use old version of the script to ensure weston starts correctly on +# sysvinit if test -z "$XDG_RUNTIME_DIR"; then - export XDG_RUNTIME_DIR=/run/user/`id -u` + export XDG_RUNTIME_DIR=/run/user/`id -u ${WESTON_USER}` + if ! test -d "$XDG_RUNTIME_DIR"; then + mkdir --parents $XDG_RUNTIME_DIR + chmod 0700 $XDG_RUNTIME_DIR + fi + if [ -n "$WESTON_USER" ] + then + chown $WESTON_USER:$WESTON_USER $XDG_RUNTIME_DIR + fi fi