Introduce libudev (branch yem/libudev)
cover Introduce libudev (branch yem/libudev)
From: "Yann E. MORIN" <[email protected]>
Hello All!
Big fat warning: this is only an RFC for now!
This series introduces the possibility to just build and install libudev, without requiring that the /dev management be handled by eudev or systemd.
A lot of packages that have a dependency on udev, in fact only require a libudev, not anudev daemon. That's the case for e.g. libinput, libcec, mesa3d...
The series starts with two cleanup patches, to remove the prompts of eudev and systemd, since they are never user-selectable; a bit of cleanup is done in the dependencies as well.
The two following patches add a new virtual package 'libudev', and the 'udev' virtual package is made a provider for this new virtual package.
Finally, the fifth patch 'upgrades' the existing eudev package with the possibility to only install libudev if needed. This is the tricky part, and is explained in the commit log. More details can be added in a future respin of the series.
No package has so far been converted to depend on libudev instead of just udev. This is relatively trivial, but I would prefer we agree on the above first. And it is late here, so let's just spin what I have for now! ;-)
On your keyboards, get set, ready... Comment! :-)
Regards,
Yann E. MORIN.
The following changes since commit 11dbb615338cd768acc2c3138064ddf557e9b60b:
hdparm: prevent package makefile from stripping the hdparm binary (2014-06-11 23:03:48 +0200)
are available in the git repository at:
git://gitorious.org/buildroot/buildroot.git
for you to fetch changes up to 972a759982e4bdbd069e2f1fb6a213aa9f829c29:
package/eudev: split udev/libudev (2014-06-12 01:29:49 +0200)
----------------------------------------------------------------
Yann E. MORIN (5):
package/eudev: remove the prompt
package/systemd: remove prompt
package/libudev: new virtual package
package/udev: is a provider for libudev
package/eudev: split udev/libudev
package/Config.in | 3 +- package/eudev/Config.in | 66 +++++++++++++++++++++++++++------------- package/eudev/eudev.mk | 46 +++++++++++++++++++++++++--- package/libudev/Config.in | 6 ++++ package/libudev/libudev.mk | 7 +++++ package/systemd/Config.in | 53 +++++++++++--------------------- package/udev/Config.in | 4 +++ package/udev/udev.mk | 2 ++ system/Config.in | 76 +++++++++++++++++++++++++++++++++++++--------- 9 files changed, 187 insertions(+), 76 deletions(-) create mode 100644 package/libudev/Config.in create mode 100644 package/libudev/libudev.mk
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
RFC PATCH 1/5 package/eudev: remove the prompt
From: "Yann E. MORIN" <[email protected]>
The package eudev depends on DEVICE_CREATION_DYNAMIC_EUDEV, and is also selected by DEVICE_CREATION_DYNAMIC_EUDEV.
This means that:
- eudev is not visible when DEVICE_CREATION_DYNAMIC_EUDEV is not set
- eudev is visible but forced when DEVICE_CREATION_DYNAMIC_EUDEV is set
As a consequence, eudev is never user-selectable.
Since the user already made the decision to use eudev in the /dev management choice, there is no point in showing the eudev package at all in the menuconfig.
Just remove the prompt.
Also remove the comments, since anyway the user can't do anything about it.
Although not strictly required, we anyway keep the dependencies expressed in eudev, to explain where they come from (fork, util-linux...), so it is explicit their duplication in the .dev management choice entry comes from eudev itself. So, update the comments there.
Also, move the help text to the /dev macnagement choice, so the user has a chance to look at it! ;-)
--- package/eudev/Config.in | 30 +++++++++--------------------- system/Config.in | 21 ++++++++++++++++----- 2 files changed, 25 insertions(+), 26 deletions(-)
package/eudev/Config.in +9 -21
@@ -1,7 +1,13 @@ +# Note: being prompt-less, and selected in the /dev management choice, +# it is not needed to have dependencies on this symbol, since the +# choice entry already have those dependencies. +# However, it seems more logical to have the dependencies listed here, +# so it is easier to uderstand why we have those, and duplicate them in +# the choice entry. + config BR2_PACKAGE_EUDEV - bool "eudev" + bool depends on !BR2_avr32 # no epoll_create1 - depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV depends on BR2_USE_MMU # uses fork() depends on BR2_LARGEFILE # util-linux depends on BR2_USE_WCHAR # util-linux
@@ -10,14 +16,6 @@ config BR2_PACKAGE_EUDEV select BR2_PACKAGE_UTIL_LINUX select BR2_PACKAGE_UTIL_LINUX_LIBBLKID select BR2_PACKAGE_KMOD - help - Userspace device daemon. This is a standalone version, - independent of systemd. It is a fork maintained by Gentoo. - - eudev requires a Linux kernel >= 2.6.34: it relies on devtmpfs - and inotify. - - http://github.com/gentoo/eudev/ if BR2_PACKAGE_EUDEV
@@ -25,18 +23,8 @@ config BR2_PACKAGE_PROVIDES_UDEV default "eudev" config BR2_PACKAGE_EUDEV_RULES_GEN - bool "enable rules generator" + bool "eudev rules generator" help Enable persistent rules generator endif - -comment "eudev needs eudev /dev management" - depends on !BR2_avr32 - depends on BR2_USE_MMU - depends on !BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV - -comment "eudev needs a toolchain w/ largefile, wchar, dynamic library" - depends on !BR2_avr32 - depends on BR2_USE_MMU - depends on !BR2_LARGEFILE || !BR2_USE_WCHAR || BR2_PREFER_STATIC_LIB
system/Config.in +16 -5
@@ -124,12 +124,23 @@ config BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV config BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV bool "Dynamic using eudev" - depends on !BR2_avr32 # eudev - depends on BR2_LARGEFILE - depends on BR2_USE_WCHAR - depends on !BR2_PREFER_STATIC_LIB - depends on BR2_USE_MMU # eudev + depends on !BR2_avr32 # eudev (no epoll_create1) + depends on BR2_USE_MMU # eudev (fork) + depends on BR2_LARGEFILE # eudev (util-linux) + depends on BR2_USE_WCHAR # eudev (util-linux) + depends on !BR2_PREFER_STATIC_LIB # eudev select BR2_PACKAGE_EUDEV + help + Userspace device daemon. This is a standalone version, + independent of systemd. It is a fork maintained by Gentoo. + + eudev requires a Linux kernel >= 2.6.34: it relies on devtmpfs + and inotify. + + You can further configure systemd in: + Target packages --> Hardware handling + + http://github.com/gentoo/eudev/ comment "eudev needs a toolchain w/ largefile, wchar, dynamic library" depends on !BR2_avr32 # eudev
Signature · 1 line
1.8.3.2
RFC PATCH 2/5 package/systemd: remove prompt
In reply to Yann E. MORINFrom: "Yann E. MORIN" <[email protected]>
The package systemd depends on BR2_INIT_SYSTEMD, and is also selected by BR2_INIT_SYSTEMD.
This means that:
- systemd is not visible when BR2_INIT_SYSTEMD is not set
- systemd is visible but forced when BR2_INIT_SYSTEMD is set
As a consequence, eudev is never user-selectable.
Since the user already made the decision to use systemd in the init system choice, there is no point in showing the systemd package at all in the menuconfig.
Just remove the prompt, and move systemd's sub-option to a sub-menu.
Although not strictly required, we anyway keep the dependencies expressed in systemd, to explain where they come from (kmod, util-linux...), so it is explicit their duplication in the init system choice entry comes from systemd itself. So, update the comments there.
Re-order dependencies, so they are the same in the systemd package and the init system choice. Add dependencies missing in the package.
Also, move the help text to the init system choice, so the user has a chance to look at it! ;-)
--- package/systemd/Config.in | 53 ++++++++++++++------------------------------ system/Config.in | 56 ++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 63 insertions(+), 46 deletions(-)
package/systemd/Config.in +17 -36
@@ -7,12 +7,22 @@ config BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS BR2_sh4a || BR2_sh4aeb || BR2_sparc || BR2_x86_64 || \ BR2_aarch64 || BR2_m68k +# Note: being prompt-less, and selected in the /dev management choice, +# it is not needed to have dependencies on this symbol, since the +# choice entry already have those dependencies. +# However, it seems more logical to have the dependencies listed here, +# so it is easier to uderstand why we have those, and duplicate them in +# the choice entry. + config BR2_PACKAGE_SYSTEMD - bool "systemd" - depends on BR2_INIT_SYSTEMD + bool + depends on BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS + depends on BR2_TOOLCHAIN_USES_GLIBC + depends on BR2_INET_IPV6 + depends on BR2_TOOLCHAIN_HAS_SSP + depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8 depends on BR2_LARGEFILE # util-linux depends on BR2_USE_WCHAR # util-linux - depends on BR2_INET_IPV6 depends on !BR2_PREFER_STATIC_LIB # kmod depends on BR2_TOOLCHAIN_HAS_THREADS # dbus depends on BR2_USE_MMU # dbus
@@ -24,42 +34,11 @@ config BR2_PACKAGE_SYSTEMD select BR2_PACKAGE_KMOD select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # kmod-tools select BR2_PACKAGE_KMOD_TOOLS - help - systemd is a system and service manager for Linux, compatible with - SysV and LSB init scripts. systemd provides aggressive parallelization - capabilities, uses socket and D-Bus activation for starting services, - offers on-demand starting of daemons, keeps track of processes using - Linux cgroups, supports snapshotting and restoring of the system - state, maintains mount and automount points and implements an - elaborate transactional dependency-based service control logic. - It can work as a drop-in replacement for sysvinit. - - Systemd requires a Linux kernel >= 3.0 with the following options - enabled: - - - CONFIG_CGROUPS - - CONFIG_INOTIFY_USER - - CONFIG_FHANDLE - - CONFIG_AUTOFS4_FS - - CONFIG_TMPFS_POSIX_ACL - - CONFIG_TMPFS_XATTR - - These options will be automatically enabled by Buildroot if - it is responsible for building the kernel. Otherwise, if you - are building your kernel outside of Buildroot, make sure - these options are enabled. - - Systemd also provides udev, the userspace device daemon. - - The selection of other packages will enable some features: - - - libglib2 package will add support for gudev. - - acl package will add support for multi-seat. - - http://freedesktop.org/wiki/Software/systemd if BR2_PACKAGE_SYSTEMD +menu "systemd" + config BR2_PACKAGE_PROVIDES_UDEV default "systemd"
@@ -132,4 +111,6 @@ config BR2_PACKAGE_SYSTEMD_SMACK_SUPPORT When this feature is enabled, Systemd mounts smackfs and manages security labels for sockets. +endmenu # "systemd" + endif
system/Config.in +46 -10
63 lines not on this page · raw message
Signature · 1 line
1.8.3.2
RFC PATCH 3/5 package/libudev: new virtual package
In reply to Yann E. MORINFrom: "Yann E. MORIN" <[email protected]>
Not all packages that currently depend on udev really need an udev daemon; most may only require a libudev.so to be available. For example, libcec, mesa3d...
Currently, we conflate udev and libudev into a single virtual package.
Introduce a new virtual package 'libudev' that packages can select if they provide libudev.so (obviously, systemd and eudev are such packages) and which packages can depend on if they just need libudev.so and not an udev daemon.
Note: only the virtual package is added for now, providers and users will be converted in followup patches.
--- package/Config.in | 1 + package/libudev/Config.in | 6 ++++++ package/libudev/libudev.mk | 7 +++++++ 3 files changed, 14 insertions(+) create mode 100644 package/libudev/Config.in create mode 100644 package/libudev/libudev.mk
package/Config.in +1 -0
@@ -636,6 +636,7 @@ menu "Hardware handling" source "package/libraw1394/Config.in" source "package/libserial/Config.in" source "package/libsoc/Config.in" + source "package/libudev/Config.in" source "package/libusb/Config.in" source "package/libusb-compat/Config.in" source "package/libv4l/Config.in"
package/libudev/Config.in new file +6 -0
@@ -0,0 +1,6 @@ +config BR2_PACKAGE_HAS_LIBUDEV + bool + +config BR2_PACKAGE_PROVIDES_LIBUDEV + depends on BR2_PACKAGE_HAS_LIBUDEV + string
package/libudev/libudev.mk new file +7 -0
@@ -0,0 +1,7 @@ +################################################################################ +# +# libudev +# +################################################################################ + +$(eval $(virtual-package))
Signature · 1 line
1.8.3.2
RFC PATCH 4/5 package/udev: is a provider for libudev
In reply to Yann E. MORINFrom: "Yann E. MORIN" <[email protected]>
Rather than having both eudev and systemd be providers of libudev, any package providing a udev daemon is a provider of libudev, too.
--- package/udev/Config.in | 4 ++++ package/udev/udev.mk | 2 ++ 2 files changed, 6 insertions(+)
package/udev/Config.in +4 -0
@@ -1,6 +1,10 @@ config BR2_PACKAGE_HAS_UDEV bool + select BR2_PACKAGE_HAS_LIBUDEV config BR2_PACKAGE_PROVIDES_UDEV depends on BR2_PACKAGE_HAS_UDEV string + +config BR2_PACKAGE_PROVIDES_LIBUDEV + default "udev" if BR2_PACKAGE_HAS_UDEV
package/udev/udev.mk +2 -0
@@ -4,4 +4,6 @@ # ################################################################################ +UDEV_PROVIDES = libudev + $(eval $(virtual-package))
Signature · 1 line
1.8.3.2
RFC PATCH 5/5 package/eudev: split udev/libudev
In reply to Yann E. MORINFrom: "Yann E. MORIN" <[email protected]>
Quite a few packages are happy with just libudev, and not a full udev daemon running.
Split the eudev package so that we can install just libudev if /dev management is not handled by eudev.
When only the library is intalled, behave as a provider for the libudev virtual package. If /dev management is handled by eudev, then only be a provider for the udev virtual package, which is itself a provider for the virtual package libudev.
Of course, libudev conflicts with systemd, but we tell the user that it is "provided" by systemd when it is selected.
Adjust comments of dependencies accordingly.
Note:
Most of the .mk splitting of the dependencies and the build/install rules are from Bernd. Thanks! :-)
---
Note: although the prompt is changed to 'libusb', we still call the package 'eudev', to avoid a mess of renaming the variables. If needed, that can be done in a separate patch.
Yeah! A virtual package can be a provider for another virtual package! Am I not sneaky? :-]
--- package/Config.in | 2 +- package/eudev/Config.in | 40 ++++++++++++++++++++++++++++++++++++++-- package/eudev/eudev.mk | 46 ++++++++++++++++++++++++++++++++++++++++++---- system/Config.in | 7 ++++--- 4 files changed, 85 insertions(+), 10 deletions(-)
package/Config.in +1 -1
@@ -288,7 +288,6 @@ endif source "package/dvbsnoop/Config.in" source "package/dtv-scan-tables/Config.in" source "package/eeprog/Config.in" - source "package/eudev/Config.in" source "package/evemu/Config.in" source "package/evtest/Config.in" source "package/fan-ctrl/Config.in"
@@ -636,6 +635,7 @@ menu "Hardware handling" source "package/libraw1394/Config.in" source "package/libserial/Config.in" source "package/libsoc/Config.in" + source "package/eudev/Config.in" # prompt is 'libudev' source "package/libudev/Config.in" source "package/libusb/Config.in" source "package/libusb-compat/Config.in"
package/eudev/Config.in +38 -2
@@ -4,8 +4,29 @@ # However, it seems more logical to have the dependencies listed here, # so it is easier to uderstand why we have those, and duplicate them in # the choice entry. +# +# Note, although named 'eudev', this package primarily provides libudev, +# unless the /dev management is selected to be eudev, in which case this +# package will provide a full udev. That's hy the prompt is 'libudev'. config BR2_PACKAGE_EUDEV + bool "libudev" + depends on !BR2_avr32 # no __NR_name_to_handle_at + depends on BR2_USE_WCHAR + depends on !BR2_PREFER_STATIC_LIB + depends on !BR2_PACKAGE_SYSTEMD + select BR2_PACKAGE_HAS_LIBUDEV if !BR2_PACKAGE_EUDEV_DAEMON + help + eudev is a fork of system-udev with the goal of obtaining better + compatibility with existing software. + + This installs only the libudev library. + + http://www.gentoo.org/proj/en/eudev/ + +if BR2_PACKAGE_EUDEV + +config BR2_PACKAGE_EUDEV_DAEMON bool depends on !BR2_avr32 # no epoll_create1 depends on BR2_USE_MMU # uses fork()
@@ -17,7 +38,7 @@ config BR2_PACKAGE_EUDEV select BR2_PACKAGE_UTIL_LINUX_LIBBLKID select BR2_PACKAGE_KMOD -if BR2_PACKAGE_EUDEV +if BR2_PACKAGE_EUDEV_DAEMON config BR2_PACKAGE_PROVIDES_UDEV default "eudev"
@@ -27,4 +48,19 @@ config BR2_PACKAGE_EUDEV_RULES_GEN help Enable persistent rules generator -endif +endif # BR2_PACKAGE_EUDEV_DAEMON + +# If the daemon is selected, it means we have a full udev, which is +# responsible for providing libudev. So only provide libudev if the +# daemon is not selected. +config BR2_PACKAGE_PROVIDES_LIBUDEV + default "eudev" if !BR2_PACKAGE_EUDEV_DAEMON + +endif # BR2_PACKAGE_EUDEV + +comment "libudev needs a toolchain w/ wchar, dynamic library" + depends on !BR2_USE_WCHAR || BR2_PREFER_STATIC_LIB + depends on !BR2_PACKAGE_SYSTEMD + +comment "libudev provided by systemd" + depends on BR2_PACKAGE_SYSTEMD
package/eudev/eudev.mk +42 -4
65 lines not on this page · raw message
system/Config.in +4 -3
@@ -160,12 +160,13 @@ config BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV config BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV bool "Dynamic using eudev" - depends on !BR2_avr32 # eudev (no epoll_create1) + depends on !BR2_avr32 # eudev depends on BR2_USE_MMU # eudev (fork) - depends on BR2_LARGEFILE # eudev (util-linux) + depends on BR2_LARGEFILE # eudev-daemon (util-linux) depends on BR2_USE_WCHAR # eudev (util-linux) depends on !BR2_PREFER_STATIC_LIB # eudev select BR2_PACKAGE_EUDEV + select BR2_PACKAGE_EUDEV_DAEMON help Userspace device daemon. This is a standalone version, independent of systemd. It is a fork maintained by Gentoo.
@@ -174,7 +175,7 @@ config BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV and inotify. You can further configure systemd in: - Target packages --> Hardware handling + Target packages --> Libraries --> Hardware handling --> libudev http://github.com/gentoo/eudev/
Signature · 1 line
1.8.3.2