diff --git a/README.md b/README.md index 156e227..958065e 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,21 @@ -libudev-zero -============ +# libudev-zero +Drop-in replacement for `libudev` that enables you to use any device manager +you like without worrying about the `udev` dependency at all! -Drop-in replacement for libudev enables you to use any device manager you like -without worrying about udev dependency at all! +## Why? +Because `udev` sucks, it is bloated and overengineered. `udev` is just like `systemd`, it locks you into using non-portable crap that you can't avoid because multiple programs depend on it. Look, even FreeBSD was forced to rewrite[1] this crappy library because `libinput` hard-depends on `udev`. Without `libinput` you can't use `wayland` and many other cool stuff. -Why ? +Michael Forney (author of `cproc`, `samurai`, Oasis Linux, ...) decided to fork[2] `libinput` and remove the hard dependency on `udev`. Is this a solution? Yes. +Is this a complete solution? No. This fork has a lot of disadvantages like requiring patching applications to use `libinput_netlink` instead of the `libinput_udev` API in order to use the automatic detection of input devices and hotplugging. Static configuration is also required for anything other than input devices (e.g drm devices). Moreover hotplugging is vulnerable to race conditions when `libinput` handles the `uevent` faster than the device manager which can lead to file permission issues. `libudev-zero` prevents these race conditions by design. -Because udev sucks, bloated and overengineered. udev is just like -systemd, lock you into using non-portable crap that you can't avoid -because many software depends on it. Look, even FreeBSD was forced to -rewrite[1] this crappy library because libinput has mandatory udev dependency. -Without libinput you can't use wayland and some other cool stuff. - -Michael Forney (cproc, samurai, Oasis Linux, ... author) decided to fork[2] -libinput and remove udev mandatority. This is solution ? Yes. This is complete -solution ? No. This fork has a lot of disadvantages like requiring patching -application from libinput_udev to libinput_netlink API in order to use -automatic detection of input devices and hotplugging. Static confuguration also -required for anything other than input devices (e.g drm devices). Moreover -hotplugging vulnerable to race conditions when libinput handles uevent faster -than device manager which can lead to file permissions issues. libudev-zero -prevents these race conditions by design. - -Thanks god udev has stable API and hopefully no changes will be made in -future. On this basis i decided to create this clean-room implementation of -libudev which can be used with any or without device manager. +Thankfully `udev` has stable API and hopefully no changes will be made to it the future. On this basis I decided to create this clean-room implementation of `libudev` which can be used with any or without a device manager. [1] https://github.com/FreeBSDDesktop/libudev-devd [2] https://github.com/oasislinux/libinput -What Works ----------- - +## What Works * [x] xorg-server -* [ ] dosfstools - need implement udev_enumerate_add_match_parent() +* [ ] dosfstools - need to implement udev_enumerate_add_match_parent() * [x] libinput * [x] usbutils * [x] wlroots @@ -42,79 +24,52 @@ What Works * [x] kwin - [fix](https://github.com/dilyn-corner/KISS-kde/commit/0cc72748e46f859a0fced55b0c3fcc1dd9586a38) * [ ] ??? -Dependencies ------------- - +## Dependencies * C99 compiler (build time) * POSIX make (build time) * POSIX & XSI libc * epoll & inotify * Linux >= 2.6.39 -Installation ------------- +## Installation ```sh make -make PREFIX=/usr install # will overwrite existing udev libraries if any -# rebuild all packages which depends on udev -# here we go ! +make PREFIX=/usr install # this will overwrite udev libraries if they exist +# rebuild all the packages that depend on libudev, and you're ready to go. ``` -Hotplugging ------------ +## Hotplugging +Note that hotplugging support is fully optional! You can skip this step if you don't have a need for the hotplugging capability. -Note that hotplugging support is fully optional! You can skip this step if you -don't have anything to hotplug. +Hotplugging is fairly uncomplicated and not overengineered at all. Everything is portable as much as possible. To use hotplugging the only thing you need is a `uevent` receiver (like a device manager, busybox's `uevent`, `CONFIG_UEVENT_HELPER`, ...). I will explain only the `mdev` and `CONFIG_UEVENT_HELPER` methods because their usage is fairly basic. For busybox's `uevent` you need to write your own parser which is kinda, well, complex. -There is no complicated or overengineered way to use hotplugging. Everything is -portable as much as possible. To use hotplugging the only thing you need is -uevent's receiver (device manager, busybox `uevent`, CONFIG_UEVENT_HELPER, ...). -I will describe only mdev and CONFIG_UEVENT_HELPER because their usage is very basic. -For busybox `uevent` you need to write your own parser which is kinda ... complex. +`UDEV_MONITOR_DIR` is an arbitrary directory where the `uevent` files are stored. The default is `/tmp/.libudev-zero`. You can change it at build time by appending `-DUDEV_MONITOR_DIR=