You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
3.3 KiB

  1. From af4dc2ff14b020840bf5d4ac3501d639314fb55d Mon Sep 17 00:00:00 2001
  2. From: illiliti <illiliti@protonmail.com>
  3. Date: Wed, 8 Sep 2021 21:26:18 +0300
  4. Subject: [PATCH 04/15] readme: rewrite why, add pros/cons
  5. ---
  6. README.md | 50 +++++++++++++++++++++++++++++++-------------------
  7. 1 file changed, 31 insertions(+), 19 deletions(-)
  8. --- a/README.md
  9. +++ b/README.md
  10. @@ -4,25 +4,37 @@ Drop-in replacement for `libudev` intend
  11. ## Why?
  12. -Because `udev` sucks, it is bloated and overengineered. `udev` is just
  13. -like `systemd`, it locks you into using non-portable crap that you can't
  14. -avoid because multiple programs depend on it. Look, even FreeBSD was forced
  15. -to rewrite[0] this crappy library because `libinput` hard-depends on `udev`.
  16. -Without `libinput` you can't use `wayland` and many other cool stuff.
  17. -
  18. -Michael Forney (author of `cproc`, `samurai`, Oasis Linux, ...) decided to
  19. -fork[1] `libinput` and remove the hard dependency on `udev`. However, this
  20. -fork has a drawback that requires patching applications to use `libinput_netlink`
  21. -instead of the `libinput_udev` API in order to use the automatic detection of
  22. -input devices and hotplugging. Static configuration is also required for anything
  23. -other than input devices (e.g drm devices).
  24. -
  25. -Thankfully `udev` has stable API and hopefully no changes will be made to it
  26. -the future. On this basis I decided to create this clean-room implementation
  27. -of `libudev` which can be used with any or without a device manager.
  28. -
  29. -[0] https://github.com/FreeBSDDesktop/libudev-devd
  30. -[1] https://github.com/oasislinux/libinput
  31. +We all know that systemd is very hostile towards portability. Udev inherited
  32. +the same problem by exposing a very badly designed library interface. This is
  33. +dramatically reduces portability, user choice and basically creates vendor
  34. +lock-in because library interface highly tied to udev daemon.
  35. +
  36. +Another udev problem is non-portable home-grown language called "udev rules".
  37. +Udev authors definitely don't know(or care) why it's better to avoid reinventing
  38. +the wheel. Strictly speaking, I think they did that on purpose to overcomplicate
  39. +udev as much as possible. Why? So that only authors(RedHat/IBM) can rule and dictate
  40. +the future of udev. The recent eudev death only proves that it's really hard to
  41. +support such unmaintainable mess.
  42. +
  43. +Udev hwdb is yet another illustration of systemd-like approach. What the hell
  44. +"userspace /dev" has to do with parsing hardware database(pci.ids, usb.ids)
  45. +and setting/remapping buttons? Udev smells like systemd by trying to implement
  46. +all possible functionality in the single daemon/code base. Standalone UNIX-way
  47. +programs much better suited for such purposes.
  48. +
  49. +Keep in mind that libudev-zero isn't ideal. Here is some pros/cons:
  50. +
  51. +### Pros
  52. +
  53. +* Very portable. Doesn't depend on GNU features.
  54. +* No lock-in. Any device manager can be used, even smdev and CONFIG_UEVENT_HELPER.
  55. +* Source code is much cleaner than udev because of less abstractions and clever code.
  56. +
  57. +### Cons
  58. +
  59. +* Udev rules must be converted to shell script in order to work with any device manager.
  60. +* Udev hwdb interface isn't implemented. pciutils and usbutils will not display any meaningful info.
  61. +* Many functions and interfaces still aren't implemented, which may lead to breakage in some programs.
  62. ## What doesn't work