]> code.ossystems Code Review - openembedded-core.git/commitdiff
weston-init: introduce WESTON_GROUP
authorRichard Leitner <richard.leitner@skidata.com>
Wed, 4 Nov 2020 14:25:32 +0000 (15:25 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 8 Nov 2020 14:03:16 +0000 (14:03 +0000)
Currently the WESTON_USER variable is used as user and group name for
chown'ing XDG_RUNTIME_DIR. If WESTON_USER has no group with the same
name this fails.

Therefore add a new WESTON_GROUP variable which is set to WESTON_USER if
not specified to ensure backwards compatibility.

Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-graphics/wayland/weston-init/weston-start

index ccc70934259c1c6a83805f4fd2ce165c50e326c9..0b93dc964a1d9e5348cd3555ddd1a7edb1c0b178 100755 (executable)
@@ -33,6 +33,10 @@ if [ -n "$WESTON_USER" ]; then
                echo "ERROR: If you have WESTON_USER variable set, you also need WESTON_TTY."
                exit 1
        fi
+       if [ -z "$WESTON_GROUP" ]; then
+               # no explicit WESTON_GROUP given, therefore use WESTON_USER
+               export WESTON_GROUP="${WESTON_USER}"
+       fi
        weston_args_user="-u $WESTON_USER -t $WESTON_TTY"
 fi
 
@@ -75,7 +79,7 @@ if test -z "$XDG_RUNTIME_DIR"; then
        fi
        if [ -n "$WESTON_USER" ]
        then
-               chown $WESTON_USER:$WESTON_USER $XDG_RUNTIME_DIR
+               chown $WESTON_USER:$WESTON_GROUP $XDG_RUNTIME_DIR
        fi
 fi