Re: [dev] GPL free Linux

From: Michael Forney <mforney_AT_mforney.org>
Date: Mon, 12 Nov 2018 13:14:38 -0800

On 2018-11-12, Markus Wichmann <nullplan_AT_gmx.net> wrote:
> On Mon, Nov 12, 2018 at 11:17:49AM +0000, Alessandro Pistocchi wrote:
>> I would use some help to make it work with X ( does it work with
>> Wayland? ). There are not many docs I found about it...
>
> Ah, that old chestnut. As far as I know, the X input driver "evdev"
> depends on the paths of the event devices being in /dev/input, and on
> you having read access to them. I don't know if smdev puts them there by
> default, nor how it sets the permissions on those files. Also, there's a
> dependency on libudev in there somewhere. I don't know if that can pick
> up files from smdev.

I don't know about smdev, but if your /dev is a devtmpfs, the kernel
will create those devices automatically with permissions 600
root:root. I run a system without any hotplug daemon, just
CONFIG_DEVTMPFS and CONFIG_DEVTMPFS_MOUNT, and a script that runs at
startup to set /dev/dri/* to 660 root:video and /dev/snd/* to 660
root:audio.

> The files should be named according to the links in /sys/class/input.
> You should also be able to see the error messages in X11's log file.
> That should tell you what's wrong. And if all else fails: strace.
>
> I have no experience with Wayland but I suppose it requires a similar
> setup. Not having read permission on a device file is a showstopper no
> matter the codebase.

Usually how it works is either the display server itself needs to be
setuid to open those input devices, or some other program (commonly
systemd-logind) needs to open it on its behalf. I believe Xorg with
systemd disabled will need to be setuid because of this.

Wayland compositors work the same way. They either run setuid so they
can open devices themselves, communicate with systemd-logind to get
device FDs, or with some parent setuid "launcher" program which opens
the devices for them. For swc, I went with the third approach.

Regarding hotplugging and libudev, most wayland compositors use
libinput to handle input devices, which uses libudev to detect when
devices are added or removed. I believe libudev *does* work without
udevd running (not completely sure). However, you can also just listen
to netlink uevents to do the same thing. I maintain a branch of
libinput that does exactly this:
https://github.com/michaelforney/libinput/blob/master/src/netlink-seat.c

Xorg seems to work similarly, and you might be able to avoid libudev
and retain hotplug support by writing a "netlink" config backend here:
https://cgit.freedesktop.org/xorg/xserver/tree/config

>> I want to have a windowing system, compilers and libraries mainly.
>> Also I need make and I would like to have flex and bison. Maybe a web
>> browser and a graphical IDE for source code editing but I am not even
>> sure about that.
>
> I was going to ask "Why not just use sta.li?" but that project
> apparently doesn't exist anymore.
>
> And that is pretty much exactly what I want from a distribution as well,
> and I just use Debian (you know you can just remove systemd from Debian,
> right?)

My own oasis project has all of those components and was inspired by
sta.li, though avoiding GPL has not been a primary goal. It has some
main components that are GPL including gcc, e2fsprogs, git, iproute2,
kbd, fuse, and netsurf.
Received on Mon Nov 12 2018 - 22:14:38 CET

This archive was generated by hypermail 2.3.0 : Mon Nov 12 2018 - 22:24:07 CET