Weston does not start with "Failed to open device: No such file or directory, Try again..."

2023-02-17 Thread Martin Petzold

Hello,

Environment: Debian bullseye (custom build using debootstrap), Kernel 
5.10.52, Weston 9.0.0-1, systemd 247.3-7+deb11u1.


I am struggling to get weston running as a user. It is working on some 
other Debian bullseye BSP image, but not in my Debian image (both are 
very similar). When I use weston-launch in a systemd service and add a 
"--user" and "--tty" (see service below), I always get the following error:


##

Feb 17 12:16:24 tavla systemd[1]: Starting DISPLAY Wayland Service...
Feb 17 12:16:24 tavla systemd[1]: Started DISPLAY Wayland Service.
Feb 17 12:16:24 tavla sudo[948]: pam_unix(sudo:session): session closed 
for user root
Feb 17 12:16:24 tavla weston-launch[952]: pam_unix(login:session): 
session opened for user tavla-run(uid=1001) by (uid=0)

Feb 17 12:16:24 tavla systemd-logind[344]: New session 9 of user tavla-run.
Feb 17 12:16:24 tavla systemd[1]: Started Session 9 of user tavla-run.
Feb 17 12:16:24 tavla systemd-logind[344]: Failed to apply ACLs: 
Operation not supported

Feb 17 12:16:24 tavla DISPLAY Wayland[957]: Date: 2023-02-17 CET
Feb 17 12:16:24 tavla DISPLAY Wayland[957]: [12:16:24.605] weston 9.0.0
Feb 17 12:16:24 tavla DISPLAY Wayland[957]: https://wayland.freedesktop.org
Feb 17 12:16:24 tavla DISPLAY Wayland[957]:    Bug reports 
to: https://gitlab.freedesktop.org/wayland/weston/issues/

Feb 17 12:16:24 tavla DISPLAY Wayland[957]:    Build: 9.0.0
Feb 17 12:16:24 tavla DISPLAY Wayland[957]: [12:16:24.605] Command line: 
/usr/bin/weston
Feb 17 12:16:24 tavla DISPLAY Wayland[957]: [12:16:24.605] OS: Linux, 
5.10.52-gba9ade6851ca-dirty, #1 SMP PREEMPT Fri Feb 17 09:13:57 UTC 
2023, aarch64
Feb 17 12:16:24 tavla DISPLAY Wayland[957]: [12:16:24.606] Using config 
file '/etc/xdg/weston/weston.ini'
Feb 17 12:16:24 tavla DISPLAY Wayland[957]: [12:16:24.606] Output 
repaint window is 16 ms maximum.
Feb 17 12:16:24 tavla DISPLAY Wayland[957]: [12:16:24.606] Loading 
module '/usr/lib/aarch64-linux-gnu/libweston-9/drm-backend.so'
Feb 17 12:16:24 tavla DISPLAY Wayland[957]: [12:16:24.612] initializing 
drm backend
Feb 17 12:16:24 tavla DISPLAY Wayland[957]: [12:16:24.616] logind: 
session control granted
Feb 17 12:16:24 tavla DISPLAY Wayland[957]: [12:16:24.624] using 
/dev/dri/card1
Feb 17 12:16:24 tavla DISPLAY Wayland[957]: [12:16:24.624] DRM: supports 
atomic modesetting
Feb 17 12:16:24 tavla DISPLAY Wayland[957]: [12:16:24.624] DRM: does not 
support GBM modifiers
Feb 17 12:16:24 tavla DISPLAY Wayland[957]: [12:16:24.624] DRM: supports 
picture aspect ratio
Feb 17 12:16:24 tavla DISPLAY Wayland[957]: [12:16:24.624] Loading 
module '/usr/lib/aarch64-linux-gnu/libweston-9/g2d-renderer.so'
Feb 17 12:16:25 tavla DISPLAY Wayland[957]: [ 1] Failed to open 
device: No such file or directory, Try again...
Feb 17 12:16:26 tavla DISPLAY Wayland[957]: [ 2] Failed to open 
device: No such file or directory, Try again...
Feb 17 12:16:27 tavla DISPLAY Wayland[957]: [ 3] Failed to open 
device: No such file or directory, Try again...
Feb 17 12:16:28 tavla DISPLAY Wayland[957]: [ 4] Failed to open 
device: No such file or directory, Try again...
Feb 17 12:16:28 tavla DISPLAY Wayland[957]: [ 5] _OpenDevice(1249): 
FATAL: Failed to open device, errno=No such file or directory.
Feb 17 12:16:28 tavla weston-launch[952]: pam_unix(login:session): 
session closed for user tavla-run
Feb 17 12:16:28 tavla sudo[961]:    tavla : TTY=pts/0 ; PWD=/home/tavla 
; USER=root ; COMMAND=/usr/bin/journalctl
Feb 17 12:16:28 tavla sudo[961]: pam_unix(sudo:session): session opened 
for user root(uid=0) by tavla(uid=1000)
Feb 17 12:16:28 tavla systemd[1]: tavla-display.service: Main process 
exited, code=exited, status=1/FAILURE


##

I tried to change tty owner (chown tavla-run:tty /dev/tty7), however, 
after the service starts the owner is set to "root".


This _does not happen_ in the other image (owner of /dev/tty7 remains 
"tavla-run" and weston starts as this user). What is going on?


Groups of user "tavla-run": tavla-run tty dialout audio video bluetooth 
i2c tavla netdev


## /lib/systemd/system/weston.service

[Unit]
Description=DISPLAY Wayland Service

After=dbus.socket systemd-user-sessions.service
Wants=dbus.socket
Before=tavla-run.service

[Service]
SyslogIdentifier=DISPLAY Wayland

PAMName=login

Environment=DISPLAY=:0

# Grab tty7
UtmpIdentifier=tty7
TTYPath=/dev/tty7
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes

# Weston does not successfully change VT, nor does systemd place us on
# the VT it just activated for us. Switch manually:
ExecStartPre=/bin/chvt 7
ExecStart=/usr/bin/weston-launch --tty /dev/tty7 --user tavla-run --

IgnoreSIGPIPE=no

[Install]
WantedBy=default.target

##

Thanks,

Martin



Re: Weston does not start with "Failed to open device: No such file or directory, Try again..."

2023-02-17 Thread Daniel Stone
Hi Martin,

On Fri, 17 Feb 2023 at 11:27, Martin Petzold  wrote:
> Feb 17 12:16:24 tavla DISPLAY Wayland[957]: [12:16:24.624] Loading module 
> '/usr/lib/aarch64-linux-gnu/libweston-9/g2d-renderer.so'
> Feb 17 12:16:25 tavla DISPLAY Wayland[957]: [ 1] Failed to open device: 
> No such file or directory, Try again...
> Feb 17 12:16:26 tavla DISPLAY Wayland[957]: [ 2] Failed to open device: 
> No such file or directory, Try again...
> Feb 17 12:16:27 tavla DISPLAY Wayland[957]: [ 3] Failed to open device: 
> No such file or directory, Try again...
> Feb 17 12:16:28 tavla DISPLAY Wayland[957]: [ 4] Failed to open device: 
> No such file or directory, Try again...
> Feb 17 12:16:28 tavla DISPLAY Wayland[957]: [ 5] _OpenDevice(1249): 
> FATAL: Failed to open device, errno=No such file or directory.

g2d-renderer comes from the NXP fork of Weston, customised to work on
their downstream kernels with their libraries. It's presumably looking
for some kind of G2D device node which it can't see for some reason.

If you're using an upstream kernel then vanilla Weston 9.0.0 (with no
NXP patches) works great there on i.MX devices. If you're using a
downstream kernel/GLES/Weston/etc from NXP, then I'm afraid you need
to contact them for support.

Cheers,
Daniel