I've been trying to package wlroots for Alpine Linux/postmarketOS, with the intention to eventually both run Sway and Phosh. wlroots compiled without any issues on Musl (for which I applaude you guys) and rootston runs fine when running as root.
From what I understand though, to run it without root rights, it needs a logind implementation. Since we do not have systemd (and thus no logind) or elogind, I'd like to request support for ConsoleKit2 as well.
On non-logind systems, you can set the suid bit on the compositor binary. The compositor should become DRM master and then drop privileges. Is that enough?
It would do for now I guess, but the suid bit is discouraged and frowned upon on this distro due to security issues, so I'd still like ConsoleKit2 support.
For Alpine in particular I've been slowly working on porting elogind. For now I use suid.
Even then I'd prefer ConsoleKit2 support rather than using an alternative session manager than all current packaged DE's use :wink:
It does mean it's not as high priority any more though.
I have ConsoleKit2 working on FreeBSD, so I'll try implementing support for it here soon because of that :)
With FreeBSD's lack of major/minor numbers for device nodes, I don't see how https://consolekit2.github.io/ConsoleKit2/#Session.TakeDevice is going to work.
That's the way to open devices without requiring root, so if that doesn't work, this whole thing would be pretty pointless for FreeBSD.
Being a DBus API, that means we'd need to pull in another dependency implementing that, as the current code uses libsystemd/libelogind. I don't like the idea of having multiple DBus libraries, but I dislike the idea of using something crappy like libdbus/gdbus even more.
Also, considering the lack of any major distro which uses this, I'm not convinced this is worth the effort.
When I said I have it working, I mean really actually fully working — I'm currently writing this from modified Weston that was launched with CK2 :) I can also start KWin, but that doesn't pick up input devices for some reason (needs more work).
lack of major/minor numbers for device nodes
That's not true, they are there, they just don't mean the same thing as on Linux:
These numbers are not divided in device classes and are not guaranteed to be stable upon reboot or driver reload.
Which works well enough for identifying evdev nodes:
% la /dev/input
total 1
dr-xr-xr-x 2 root wheel 512 Jan 15 12:41 .
dr-xr-xr-x 16 root wheel 512 Jan 15 15:41 ..
crw------- 1 root wheel 0x17 Jan 15 12:41 event0
crw------- 1 root wheel 0x1a Jan 15 12:41 event1
crw------- 1 root wheel 0x53 Jan 15 12:41 event2
crw------- 1 root wheel 0x2c0 Jan 15 15:41 event3
crw------- 1 root wheel 0x2c9 Jan 15 15:41 event4
crw------- 1 root wheel 0x2d0 Jan 15 12:42 event5
crappy like libdbus
What's so crappy about it? And why does that even matter? It's the standard, systemd-independent client library.
worth the effort
I'll do it either way, and if you don't end up accepting it, it'll have to live in FreeBSD's and Alpine's patches :(
(Personal note: a logind alternative not relying on D-Bus would be nice to have)
We have no plans to support ConsoleKit2, as we now entirely rely on libseat for our session code. Maybe have a look at seatd for a maintained replacement.
Most helpful comment
(Personal note: a logind alternative not relying on D-Bus would be nice to have)