Mail archive
alpine-devel

Re: [alpine-devel] udev replacement in Alpine Linux

From: Christoph Lohmann <20h_at_r-36.net>
Date: Mon, 27 Jul 2015 12:41:39 +0200

Greetings.

On Mon, 27 Jul 2015 12:41:39 +0200 Natanael Copa <ncopa_at_alpinelinux.org> wrote:
> On Sun, 26 Jul 2015 12:10:26 +0200
> Christoph Lohmann <20h_at_r-36.net> wrote:
>
> However, using netlink has the drawback that it requires a forever
> running daemon, and normally you only need it during bootup, and after
> that, you need it seldomly, when you plug in an usb disk, a mouse or
> similar.

But the interactive part is where the arguments of the systemd disease
comes from. There simple scripts have to adapt and make it possible to
use Linux in this too fast changing world.

> > The KISS way I imagined would be this way: nldev not just
> > executing mdev, but it caching the configuration file for the
> > speedup. That*s what smdev tries to do but it does not implement all
> > of the busybox mdev.conf syntax.
>
> Here is what I have been thinking, and what came out of a long
> discussion on busybox mailing list.
>
> Implement the netlink daemon as a socket activator. When there is a new
> event, fork/exec the handler and pass over the socket.
>
> The handler reads the events from the socket and handles them. Set a
> timout on the socket and exit when there are no events withing one or two
> seconds. The socket activator takes over again.

Processes and sockets are cheap in Linux. There is no need for this com‐
plexity. Keep it simple.

You will have more problems by adapting to the dbus herd. There long‐
running daemons are the norm. But that’s a different topic which might
get addressed in the future either by the demise of the developers of
that crappy services or by having yet another important part of Linux
(Bluetooth anyone?) depending on such a false design.

> I have this implemented, based on nldev code:
> http://git.alpinelinux.org/cgit/user/ncopa/nlplug/tree/

These are simple changes. You could have sent me the patch for nldev in‐
stead of splitting it up again and creating a blackhole in juridical
questions by adding a half‐baked license line. Now there’s another
project. As I recommended, all of this should be now done under smdev at
suckless.org.

> > What needs to be done for solving this udev problem once and for all
> > and have a modular replacement:
> > * Send in patches to smdev to have the complete busybox syntax
> > mdev.conf implemented so all the mdev.conf examples out there can be
> > reused.
> > * Create a repository with all kind of mdev scripts so they can be
> > reused.
> > * Rip off libudev-compat from vdev and have it a separate package, if
> > needed.
>
> Alternatively, we could make an alternative xorg config backend. It
> does not look too difficult:
> http://cgit.freedesktop.org/xorg/xserver/tree/config/udev.c

Wrong. Be liberal in what you produce and conservative in what you ac‐
cept. And, with the work of vdev and the rip off nearly all work is
done. Just add all the pieces and you are done in one productive day.

> > I invite all interested developers to join suckless in its strive
> > for a better KISS future and send patches to hackers_at_suckless.org
> > for the smdev[0] project or to implement the libudev*compat or join
> > discussions on dev_at_suckless.org.
>
> I think it might make sense to do the mdev.conf parsing and event
> handlig from either busybox or toybox. Those toolboxes also have things
> like modprobe and blkid, which should make it possible to load
> modaliases without fork/exec and find root=... on /proc/cmdline. (very
> useful from initramfs)

There is sbase in suckless.org, which does much of that too. Keep every‐
thing simple and don’t add dependencies you can just assume from wherev‐
er they come from. You will join the complexity spiral.


Sincerely,

Christoph Lohmann



---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Mon Jul 27 2015 - 12:41:39 GMT