From 1214a094b649ddbe7e26c42dd78f669c1d34948e Mon Sep 17 00:00:00 2001 From: Tatiana Leon Date: Thu, 2 Feb 2023 09:44:22 +0100 Subject: [PATCH] ccmp15: crank-demo: fix autostart of crank app on top of weston NXP and ST platforms launches weston in a different way. In ccmp15 we must wait for the socket at '/run/user/0/wayland-1' after weston is initialized, while that is not required on NXP platforms. This commit reverts part of the changes in commit 31d9863feabcfb00356c2d697da51c3431738c47. Signed-off-by: Tatiana Leon --- .../crank-demos/crank-demos/crank-demo-init | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-crank/crank-demos/crank-demos/crank-demo-init b/meta-digi-dey/recipes-crank/crank-demos/crank-demos/crank-demo-init index a9eeb67f3..5fbd42ad1 100644 --- a/meta-digi-dey/recipes-crank/crank-demos/crank-demos/crank-demo-init +++ b/meta-digi-dey/recipes-crank/crank-demos/crank-demos/crank-demo-init @@ -1,7 +1,7 @@ #!/bin/sh #=============================================================================== # -# Copyright (C) 2022 by Digi International Inc. +# Copyright (C) 2022, 2023 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -58,6 +58,20 @@ check_is_running() { return 1 } +wait_for_wayland() { + local count=20 + local wayland_socket="/run/user/0/${DEMO_DISPLAY}" + + while [ ! -S "${wayland_socket}" ]; do + sleep 1 + count=$((count-1)) + if [ "${count}" = 0 ]; then + return 1 + fi + done + return 0 +} + stop() { check_is_running || return @@ -78,6 +92,7 @@ stop() { start() { check_is_running && { log warning "start: ${CRANK_DEMO} ALREADY running"; exit 0; } + [ -d "/usr/share/wayland" ] && wait_for_wayland env ${DEMO_ENV} ${SB_LAUNCHER_SCRIPT} ${DEMO_OPTS} ${DEMO} >/dev/null 2>&1 & if [ $? -eq 0 ]; then echo $! > ${PID_FILE}