Mail archive
alpine-devel

[alpine-devel] udev replacement in Alpine Linux

From: Christoph Lohmann <20h_at_r-36.net>
Date: Sun, 26 Jul 2015 12:10:26 +0200

Greetings.

Alan Pillay was asking me to join in on the discussion about Alpine Lin‐
ux needing a udev replacement to strive more towards a KISS future of
this distribution.

I am the author of nldev and nlmon, which I am using personally on my
Laptop. During this development my goal was to have a KISS solution to
the udev mess and its abstraction layers. Well, the idea never complete‐
ly finished due to me being satisfied with what nldev and nlmon do and
no reason to write the biggest threat to motivation: a libudev replace‐
ment.

I’m just describing how device management in Linux works now:

1.) mount devtmpfs onto /tmp on your own or let the kernel do it
    * this will have the kernel create all devices on its own but without any
      permissions

Now there are two options:
1.1.) Give the kernel an application to run on each new device event.
1.2.) Listen on a netlink socket for events and handle the device events.

The first option is what mdev does and the second one is what udev,
smdev and nldev do.

What’s the problem with the first approach and why udev exists? There is
no concurrency. How does udev solve this? By parallel execution but in
the end waiting / settling for all events to have happened. Of course it
was extended to even more methodologies and is now the abscess of sys‐
temd.

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. For compatibility reasons the libudev‐compat needs to be ripped
off into a separate project so you don’t infect smdev with systemd code.
The libudev compatibility is especially needed for X.org and dynamic
uevent device discovery.

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.

Please don’t use vdev. It does not follow the KISS principles and uses
C++. The namespace for gid/uid is a big hack which should be in the
kernel, as it is in Plan 9.

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.


Sincerely,

Christoph Lohmann

[0] http://git.suckless.org/smdev/



---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Sun Jul 26 2015 - 12:10:26 GMT