diff --git a/meta-digi-dey/recipes-graphics/wayland/weston-init.bbappend b/meta-digi-dey/recipes-graphics/wayland/weston-init.bbappend index 9dcc65394..d1f322eca 100644 --- a/meta-digi-dey/recipes-graphics/wayland/weston-init.bbappend +++ b/meta-digi-dey/recipes-graphics/wayland/weston-init.bbappend @@ -1,4 +1,4 @@ -# Copyright (C) 2019 Digi International. +# Copyright (C) 2019-2021 Digi International. FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" @@ -11,6 +11,20 @@ SRC_URI += " \ # and uncomment with an individual append INI_UNCOMMENT_ASSIGNMENTS_remove_ccimx6 = "use-g2d=1" +INI_UNCOMMENT_ASSIGNMENTS_append_mx8ulp = " \ + use-g2d=1 \ +" + +WATCHDOG_SEC = "40" +WATCHDOG_SEC_mx8ulp = "240" + +update_file() { + if ! grep -q "$1" $3; then + bbfatal $1 not found in $3 + fi + sed -i -e "s,$1,$2," $3 +} + do_install_append_ccimx6() { uncomment "use-g2d=1" ${D}${sysconfdir}/xdg/weston/weston.ini } @@ -18,6 +32,15 @@ do_install_append_ccimx6() { do_install_append() { install -Dm0755 ${WORKDIR}/profile ${D}${sysconfdir}/profile.d/weston.sh + # Add weston.log back, used by NXP for testing + update_file "ExecStart=/usr/bin/weston " "ExecStart=/usr/bin/weston --log=\$\{XDG_RUNTIME_DIR\}/weston.log " ${D}${systemd_system_unitdir}/weston.service + + # FIXME: weston should be run as weston, not as root + update_file "User=weston" "User=root" ${D}${systemd_system_unitdir}/weston.service + update_file "Group=weston" "Group=root" ${D}${systemd_system_unitdir}/weston.service + + update_file "WatchdogSec=20" "WatchdogSec=${WATCHDOG_SEC}" ${D}${systemd_system_unitdir}/weston.service + # Add custom background image install -d ${D}${datadir}/weston install ${WORKDIR}/digi_background.png ${D}${datadir}/weston diff --git a/meta-digi-dey/recipes-graphics/wayland/weston-init/imx/weston.ini b/meta-digi-dey/recipes-graphics/wayland/weston-init/imx/weston.ini new file mode 100644 index 000000000..eccc633a9 --- /dev/null +++ b/meta-digi-dey/recipes-graphics/wayland/weston-init/imx/weston.ini @@ -0,0 +1,32 @@ +[core] +#gbm-format=argb8888 +#gbm-format=rgb565 +idle-time=0 +#use-g2d=1 +#xwayland=true +#repaint-window=16 +#enable-overlay-view=1 +modules=screen-share.so + +#[shell] +#size=1920x1080 + +[libinput] +touchscreen_calibrator=true + +#[output] +#name=HDMI-A-1 +#mode=1920x1080@60 +#transform=rotate-90 + +#[output] +#name=HDMI-A-2 +#mode=off +# WIDTHxHEIGHT Resolution size width and height in pixels +# off Disables the output +# preferred Uses the preferred mode +# current Uses the current crt controller mode +#transform=rotate-90 + +[screen-share] +command=/usr/bin/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize --rdp-tls-cert=/etc/freerdp/keys/server.crt --rdp-tls-key=/etc/freerdp/keys/server.key diff --git a/meta-digi-dey/recipes-graphics/wayland/weston-init/profile b/meta-digi-dey/recipes-graphics/wayland/weston-init/profile index d5c25df73..078599f42 100644 --- a/meta-digi-dey/recipes-graphics/wayland/weston-init/profile +++ b/meta-digi-dey/recipes-graphics/wayland/weston-init/profile @@ -1,12 +1,9 @@ #!/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... if test -z "$XDG_RUNTIME_DIR"; then - 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 + export XDG_RUNTIME_DIR=/run/user/`id -u` fi