iMX8MM & BSP6: Is it still necessary to launch weston as root?

Hello,

I’m using a Verdin iMX8MM with BSP v6.0.
In the tdx-reference-multimedia-image weston is started with the systemd-service /lib/systemd/system/weston.service and the socket /lib/systemd/system/weston.socket. In this files the user and the group are set to root.

This allows only applications launched with root privileges to connect to the display server to show their content. I don’t think this is a good practice.

I found both files in the directory openembedded-core/meta/recipes-graphics/weston-init/ where user and group are set to weston resp. wayland. But the recipe meta-toradex-bsp-common/recipes-graphics/wayland/weston-init.bbappend changed these settings to root because of this commit.

Is this workaround still necessary? Why are user and group in weston.socket changed too?

Best regards,
Markus

Hi @Mowlwurf ,

Happy New Year :tada:

This change was performed by NXP and we from Toradex are basing our BSP on this. You can try to remove this change and see if it works without it.

As commented on Toradex’s weston-init.bbappend root is needed in order to access input devices and GPU.

Let us know how it goes.

Best Regards
Kevin

Hi @kevin.tx,

thank you for your fast reply.

In both files I changed back the user and group settings to the original ones and weston starts without problems. I added the unprivileged user to the groups video and wayland and was able to start a Qt app own by the user on a touchscreen. Touch and keyboard inputs are working too.

So for me it seems that this workaround isn’t necessary anymore.

Best regards,
Markus

Hi @Mowlwurf ,

Thanks for confirming :+1:

We’ll pass that on internally.

Best Regards
Kevin

Hi @kevin.tx,

I discovered a little downside of this: I can run the program feh only as user weston. When I try it as root I get the following error:

$ feh pictures/blue.png
Authorization required, but no authorization protocol specified
feh ERROR: Can't open X display. It *is* running, yeah?

Do you have an idea about this?

Best regards,
Markus

Hello @Mowlwurf
feh is trying to use X, and our images have Weston with Xwayland by default, so maybe you need to check the DISPLAY environment variable in order to run feh.

On the other hand, you have the weston.ini file where you can set the wallpaper.

Please refer to this article to get more information about Weston. It refers to TorizonCore, but the same Weston configuration should work for our Reference images:

Best regards,
Josep