From 6dbe58269fcbe15c1e6f2e86c8ea1cfc3de31156 Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Fri, 28 Apr 2023 15:28:37 +0200 Subject: weston-init: comment in xwayland=true for mainline BSPs The main recipe now sets xwayland=true in weston.ini, but xwayland does not really work for mainline BSPs, the following error was observed on both imx6/imx7 machines, as follows: ``` | # gst-play-1.0 testvideo_h264_360p.mp4 | Press 'k' to see a list of keyboard shortcuts. | Now playing testvideo_h264_360p.mp4 | X connection to :0.0 broken (explicit kill or server shutdown). ``` after removing "xwayland=true" from weston.ini, it works again. This patch mainly aims to resolve this problem by introducing a variable INI_COMMENT_ASSIGNMENTS that the end users could set to comment a line in weston.ini. Signed-off-by: Ming Liu --- recipes-graphics/wayland/weston-init.bbappend | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/recipes-graphics/wayland/weston-init.bbappend b/recipes-graphics/wayland/weston-init.bbappend index 478c7cd6..a742bb86 100644 --- a/recipes-graphics/wayland/weston-init.bbappend +++ b/recipes-graphics/wayland/weston-init.bbappend @@ -9,9 +9,17 @@ REQUIRED_DISTRO_FEATURES:remove = "${IMX_REQUIRED_DISTRO_FEATURES_REMOVE}" SRC_URI:append:mx6sl-nxp-bsp = " file://weston.config" # To customize weston.ini, start by setting the desired assignment in weston.ini, +# commented in. For example: +# xwayland=true +# Then add the assignment to INI_COMMENT_ASSIGNMENTS. +# # commented out. For example: # #xwayland=true # Then add the assignment to INI_UNCOMMENT_ASSIGNMENTS. +INI_COMMENT_ASSIGNMENTS:append:imx-mainline-bsp = " \ + xwayland=true \ +" + INI_UNCOMMENT_ASSIGNMENTS:append:mx8-nxp-bsp = " \ repaint-window=16 \ " @@ -33,6 +41,13 @@ INI_UNCOMMENT_ASSIGNMENTS:append = " \ ${INI_UNCOMMENT_USE_G2D} \ " +comment() { + if ! grep -q "^#$1" $2 && ! grep -q "^$1" $2; then + bbwarn "Commented setting '#$1' not found in file $2" + fi + sed -i -e 's,^'"$1"',#'"$1"',g' $2 +} + uncomment() { if ! grep -q "^#$1" $2 && ! grep -q "^$1" $2; then bbwarn "Commented setting '#$1' not found in file $2" @@ -44,6 +59,11 @@ do_install:append() { if [ -f "${WORKDIR}/weston.config" ]; then install -Dm0755 ${WORKDIR}/weston.config ${D}${sysconfdir}/default/weston fi + + for assignment in ${INI_COMMENT_ASSIGNMENTS}; do + comment "$assignment" ${D}${sysconfdir}/xdg/weston/weston.ini + done + for assignment in ${INI_UNCOMMENT_ASSIGNMENTS}; do uncomment "$assignment" ${D}${sysconfdir}/xdg/weston/weston.ini done -- cgit v1.2.3-54-g00ecf