Reminder this is UNSUPPORTED. Reproduce bugs on a stock install with xudev
/eudev
before reporting them.
Do not reboot until you've done them all.
Due to some file conflicts, udev
will have to be replaced first. This article's recommended substitute is nldev
+ smdev
(AUR packages), as all of the "glue" has already been provided by phkr, and will assume you'll be installing them to make things easier.
mkinitcpio
will run and will fail, don't mind it yet.
Install libudev-zero-git
from the AUR, replacing lib{,e}udev
.
To make hotplugging work, install
A later update to smdev-libudev-zero
from the AUR.nldev
included hotplugging support right in the config.h, so installing libudev-zero
is enough.
On OpenRC, install nldev-openrc
. Remove udev
and udev-trigger
from sysinit
, and add nldev
and nldev-trigger
to that runlevel.
On runit, install nldev-runit
.
On s6, the short and hackish way is to edit these files:
/etc/s6/sv/udevd-srv/run
- so it invokesnldev -k
instead ofudevd
./etc/s6/sv/udevadm/up
- so it invokesnltrigger /sys add 500
instead of the multipleudevadm
commands.*
Then rebuild the database with /usr/share/libalpm/scripts/s6-rc-db-update-hook
. This allows us to not care about editing tons of dependencies
files. Remember to add these files to the [options] NoUpgrade
section of pacman.conf.
* The 500 argument makes nltrigger wait half a second before actually triggering the uevents. This is necessary because nldev does not work with s6 readiness notification, and s6-rc is often literally too fast for nldev
(at least on my machine).
LVM2 and Libdevmapper (the latter of which is needed for cryptsetup) requires rebuilding these software components to remove the dependency on a deprecated udev API.
lvm2-noudev
(AUR),device-mapper-noudev
(AUR) - replace their udev-built equivalents.
To fix initramfs build errors, edit /etc/mkinitcpio.conf
and replace udev
with nldev
in the hooks. Then rebuild initramfs with sudo mkinitcpio -P
. Pay attention to build errors on this step!
See the sections on the consequences of the elogind-udev integration: first and second.
Add break=premount
or break=postmount
to your kernel command line. This will halt the initramfs before or after mounting your / partition, and will allow you to type commands in a Busybox shell.
- Modprobe yelling it can't load billions of modules during initramfs.
Programs linked against libudev complaining aboutDummy version info has been added, rebuild libudev-zero-gitno version information available
.
These errors are harmless, and are related to many things on Linux revolving around udev
.
Add yourself to groups video, audio and input and log out and log in. This is the easiest way while we don't have equivalents of udev rules that tag devices with uacess
to notify elogind. They're currently being worked on at https://github.com/capezotte/artix-elogind-smdev.
If a userspace component needs to talk to USB devices (for example, Android debugging tools), there are many ways to handle that:
- Add yourself to group usb
- Make the executable set-GID
usb
. - If it has a daemon (like ADB): start it with your init. Starting it as group
usb
+ unpriviledged user will also work, if you're concerned with a possibly increased attack surface.
Android udev rules are unfortunately massive and make use of "udev rule language" 's goto, which makes translating to shell script quite hard.
Apparently these properties are queried through udev
, and a yet-unwritten patch would be required for it to work.
However, blkid
can still be used to query device UUIDs, and smdev
can be configured to create udev-style /dev/disk/by-{,part}uuid
symlinks with the smdev-uuid
rule (packaged on the AUR).
Bluetoothd relies on a unimplemented udev interface (hwdb). Rebuilding without udev
(bluez-noudev
on the AUR) is necessary.
PulseAudio doesn't properly recognize soundcards on neither on startup nor upon plugging them with libudev-zero. Pipewire is recommended, as, although it requires a patch as part of the initial set-up, once patched it works really well, including hotplug support.
If you don't plan on recompiling/switching to Pipewire, the easy fix is running pacmd load-module module-detect
, which "asks" ALSA directly. To make this permanent, you can add this command so it runs upon X/Wayland startup, or create a file /etc/pulse/default.pa.d/noudev.pa with contents load-module module-detect
.
A user script, pulseaudio-smdev-reload can be used to supplant the lack of hotplugging support.
A difference in "quirks" between a real udev and libudev-zero simulation results in Pipewire flagging devices as invalid when they aren't. A patched version of pipewire by libudev-zero's author (pipewire-libudev-zero on AUR) allows usage with libudev-zero, including device hotplugging.
Supplementary packages (pipewire-{jack,pulse,gst-plugin...}
) don't need to be replaced.
Some people report udisks2
not working. pmount
is a udev-less alternative with similar functionality (though no support for DE's).
connman
and iwd
(as well as wpa_cli
and its wrappers like setnet
) do not link to libudev. If you have issues, you can try those.
See step 4. Gparted also requires device-mapper
, and seems to be less stable in a udev-free environment.
- Illiliti, the author of libudev-zero, in many ways responsible for this page existing.
- Platon "phkr" Ryzhikov, maintainer of many of the packages featured here, and developer of the nldev initcpio hook and init services.
- Senderman for testing and the PulseAudio hotplugging script.
With the following glue, any device manager will work:
- An mkinitcpio hook that adds the device manager's files to the initramfs, starts and "coldplugs" it.
- For OpenRC: scripts that start and coldplug the daemon.
- For runit: runit-rc (stage 1) scripts that start, "coldplug" and stop the daemon, and a stage 2 daemon service.
- For s6: instructions on what to put on /etc/s6/sv/udevd and /etc/s6/sv/udevadm.
- Compatibility with phkr's smdev scripts can be achieved by including phkr's
processdev
script in your package and adding it as an "always" rule, or by adding "run" instructions for individual /etc/smdev/add entries.
If you get these working, feel free to tell me.
Gentoo is possible, see dm9pZCAq's overlay's no-udev packages for a Gentoo-specific example.
Unmerging at least libudev is important, since you want applications to pick up libudev-zero instead of libudev so they'll source data from sysfs and nldev instead of udev. It's no crazier than wanting to replace udev in the first place (:P) and you won't need to re{configure,build} Xorg/Wayland not to use libinput (I'm using it just fine, including with some less common devices such as graphics tablets).
If you're worried about recompiling the world, it isn't urgent. The overlay has a custom virtual/udev to appease ebuild dependencies and unless it's a desktop-centric program like KDE/GNOME's device managers — in which case udev's complexity is actually necessary —, programs built against default libudev will work with libudev-zero without rebuilding.
Alas, we (dm9p and me) can't help much with OpenRC since we're using other inits (runit and s6, respectively).