Introduce libudev (branch yem/libudev-6)
v9 cover Introduce libudev (branch yem/libudev-6)
Hi,
quoting Yann from 2016:
https://lists.buildroot.org/pipermail/buildroot/2016-July/167371.html
"Hello All!
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 a udev daemon. That's the case for e.g. libinput, libcec, mesa3d...
During previous developers days, it was suggested that libudev was to be made a virtual package that could be selected (like jpeg is). So I eventually got some time to rework it (since the series was not adopted by Peter as it was discussed during those DevDays:
https://lite5.framapad.org/p/buildrootfosdem15 ;-) ).
This series is a full rewrite from scratch, with very little caried over from the previous attempts (far back in the past).
- first come a few cleanup patches;
- then eudev is split in two, virtually providing to different packages in one, with two different configure/build/install procedures, one for libudev only, one for the full package;
- then the libudev virtual package is introduced, with eudev and
systemd both declared as providers;
- libudev is made selectable, so that packages can select it instead
of depending (like is usual) on the virtual package;
- eventually, two packages are converted over to using libudev:
qt5base, as an optional implicit dependency, and libinput, as a mandatory dependency.
Not all packages that reference udev have been switched over to depend on libudev, though, since it is unclear to me whether they require a udev daemon, or would be happy with just libudev. This can be done in follow up patches once libudev is eventually in the tree (for good this time I hope! ;-) )"
This patch series was rebased on Yann's latest code from 2020:
https://git.buildroot.org/~ymorin/git/buildroot/log/?h=yem/libudev-6
as suggested in 2021:
https://lists.buildroot.org/pipermail/buildroot/2021-March/607988.html
"eudev now has had the ability to only build the library for a while already"
and more packages were ported to make use of libudev.
Bernd Kuhls (4):
package/kodi: only needs libudev, not udev daemon package/libv4l: optionally use libudev package/libcec: optionally use libudev package/usbutils: only needs libudev, not udev daemon
Yann E. MORIN (8):
package/eudev: add option to enable the udev daemon package/eudev: allow building only the library package/libudev: new virtual package package/eudev: provides libudev package/systemd: provides libudev package/libudev: make it selectable package/qt5base: optionally use libudev package/libinput: only needs libudev, not udev daemon
package/Config.in | 1 + package/eudev/Config.in | 45 +++++++++++++++++++++++++------- package/eudev/eudev.mk | 47 ++++++++++++++++++++++++---------- package/kodi/Config.in | 4 +-- package/kodi/kodi.mk | 4 +-- package/libcec/libcec.mk | 4 +-- package/libinput/Config.in | 10 +++++--- package/libinput/libinput.mk | 2 +- package/libudev/Config.in | 13 ++++++++++ package/libudev/libudev.mk | 7 +++++ package/libv4l/libv4l.mk | 4 +-- package/qt5/qt5base/qt5base.mk | 4 +-- package/systemd/Config.in | 4 +++ package/systemd/systemd.mk | 2 +- package/usbutils/Config.in | 12 ++++++--- package/usbutils/usbutils.mk | 2 +- system/Config.in | 1 + 17 files changed, 124 insertions(+), 42 deletions(-) create mode 100644 package/libudev/Config.in create mode 100644 package/libudev/libudev.mk
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v9 1/12 package/eudev: add option to enable the udev daemon
From: "Yann E. MORIN" <[email protected]>
This is currently forcefully enabled, and does not (yet) change the way we handle eudev-based /dev management, but will help introduce libudev in followup commits.
The rules generator does not make sense without the daemon, while the hardware database (hwdb) is used by the library.
--- package/eudev/Config.in | 24 +++++++++++++++++------- system/Config.in | 1 + 2 files changed, 18 insertions(+), 7 deletions(-)
package/eudev/Config.in +17 -7
@@ -4,12 +4,6 @@ config BR2_PACKAGE_EUDEV depends on BR2_USE_MMU # uses fork() depends on BR2_USE_WCHAR # needs C99 compiler depends on !BR2_STATIC_LIBS # kmod - select BR2_PACKAGE_HAS_UDEV - select BR2_PACKAGE_UDEV_GENTOO_SCRIPTS if BR2_INIT_OPENRC - select BR2_PACKAGE_UTIL_LINUX - select BR2_PACKAGE_UTIL_LINUX_LIBS - select BR2_PACKAGE_UTIL_LINUX_LIBBLKID - select BR2_PACKAGE_KMOD help eudev is a fork of systemd-udev with the goal of obtaining better compatibility with existing software such as OpenRC and
@@ -20,6 +14,20 @@ config BR2_PACKAGE_EUDEV if BR2_PACKAGE_EUDEV +config BR2_PACKAGE_EUDEV_DAEMON + bool "udev daemon" + depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV + select BR2_PACKAGE_HAS_UDEV + select BR2_PACKAGE_UDEV_GENTOO_SCRIPTS if BR2_INIT_OPENRC + select BR2_PACKAGE_UTIL_LINUX + select BR2_PACKAGE_UTIL_LINUX_LIBS + select BR2_PACKAGE_UTIL_LINUX_LIBBLKID + select BR2_PACKAGE_KMOD + help + Install the udev daemon. + +if BR2_PACKAGE_EUDEV_DAEMON + config BR2_PACKAGE_PROVIDES_UDEV default "eudev"
@@ -28,6 +36,8 @@ config BR2_PACKAGE_EUDEV_RULES_GEN help Enable persistent rules generator +endif # BR2_PACKAGE_EUDEV_DAEMON + config BR2_PACKAGE_EUDEV_ENABLE_HWDB bool "enable hwdb installation" default y
@@ -35,7 +45,7 @@ config BR2_PACKAGE_EUDEV_ENABLE_HWDB help Enables hardware database installation to /etc/udev/hwdb.bin -endif +endif # BR2_PACKAGE_EUDEV comment "eudev needs eudev /dev management" depends on BR2_USE_MMU
system/Config.in +1 -0
@@ -228,6 +228,7 @@ config BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV depends on !BR2_STATIC_LIBS depends on BR2_USE_MMU # eudev select BR2_PACKAGE_EUDEV + select BR2_PACKAGE_EUDEV_DAEMON comment "eudev needs a toolchain w/ wchar, dynamic library" depends on BR2_USE_MMU
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v9 2/12 package/eudev: allow building only the library
In reply to Bernd KuhlsFrom: "Yann E. MORIN" <[email protected]>
--- package/eudev/Config.in | 12 +++++++---- package/eudev/eudev.mk | 46 ++++++++++++++++++++++++++++------------- 2 files changed, 40 insertions(+), 18 deletions(-)
package/eudev/Config.in +8 -4
@@ -1,9 +1,9 @@ config BR2_PACKAGE_EUDEV bool "eudev" - depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV depends on BR2_USE_MMU # uses fork() depends on BR2_USE_WCHAR # needs C99 compiler depends on !BR2_STATIC_LIBS # kmod + depends on !BR2_INIT_SYSTEMD help eudev is a fork of systemd-udev with the goal of obtaining better compatibility with existing software such as OpenRC and
@@ -45,12 +45,16 @@ config BR2_PACKAGE_EUDEV_ENABLE_HWDB help Enables hardware database installation to /etc/udev/hwdb.bin -endif # BR2_PACKAGE_EUDEV - -comment "eudev needs eudev /dev management" +comment "udev daemon needs eudev /dev management" depends on BR2_USE_MMU depends on !BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV +endif # BR2_PACKAGE_EUDEV + comment "eudev needs a toolchain w/ wchar, dynamic library" depends on BR2_USE_MMU depends on !BR2_USE_WCHAR || BR2_STATIC_LIBS + depends on !BR2_INIT_SYSTEMD + +comment "eudev is incompatible with systemd init" + depends on BR2_INIT_SYSTEMD
package/eudev/eudev.mk +32 -14
72 lines not on this page · raw message
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v9 3/12 package/libudev: new virtual package
In reply to Bernd KuhlsFrom: "Yann E. MORIN" <[email protected]>
--- 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
@@ -531,6 +531,7 @@ endmenu source "package/libiec61850/Config.in" source "package/libmanette/Config.in" source "package/libubootenv/Config.in" + source "package/libudev/Config.in" source "package/libuio/Config.in" source "package/linux-backports/Config.in" source "package/linux-serial-test/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 + string + depends on BR2_PACKAGE_HAS_LIBUDEV
package/libudev/libudev.mk new file +7 -0
@@ -0,0 +1,7 @@ +################################################################################ +# +# libudev +# +################################################################################ + +$(eval $(virtual-package))
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v9 4/12 package/eudev: provides libudev
In reply to Bernd KuhlsFrom: "Yann E. MORIN" <[email protected]>
--- package/eudev/Config.in | 4 ++++ package/eudev/eudev.mk | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)
package/eudev/Config.in +4 -0
@@ -4,6 +4,7 @@ config BR2_PACKAGE_EUDEV depends on BR2_USE_WCHAR # needs C99 compiler depends on !BR2_STATIC_LIBS # kmod depends on !BR2_INIT_SYSTEMD + select BR2_PACKAGE_HAS_LIBUDEV help eudev is a fork of systemd-udev with the goal of obtaining better compatibility with existing software such as OpenRC and
@@ -14,6 +15,9 @@ config BR2_PACKAGE_EUDEV if BR2_PACKAGE_EUDEV +config BR2_PACKAGE_PROVIDES_LIBUDEV + default "eudev" + config BR2_PACKAGE_EUDEV_DAEMON bool "udev daemon" depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV
package/eudev/eudev.mk +2 -1
@@ -11,6 +11,7 @@ EUDEV_LICENSE_FILES = COPYING EUDEV_INSTALL_STAGING = YES EUDEV_DEPENDENCIES = host-gperf host-pkgconf +EUDEV_PROVIDES = libudev EUDEV_CONF_OPTS = \ --disable-manpages \
@@ -31,7 +32,7 @@ ifeq ($(BR2_PACKAGE_EUDEV_DAEMON),y) # eudev requires only the util-linux libraries at build time EUDEV_DEPENDENCIES += util-linux-libs kmod -EUDEV_PROVIDES = udev +EUDEV_PROVIDES += udev EUDEV_CONF_OPTS += \ --enable-programs \
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v9 5/12 package/systemd: provides libudev
In reply to Bernd KuhlsFrom: "Yann E. MORIN" <[email protected]>
--- package/systemd/Config.in | 4 ++++ package/systemd/systemd.mk | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
package/systemd/Config.in +4 -0
@@ -25,6 +25,7 @@ menuconfig BR2_PACKAGE_SYSTEMD depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14 # LOOP_SET_BLOCK_SIZE depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 depends on BR2_HOST_GCC_AT_LEAST_5 # host-systemd + select BR2_PACKAGE_HAS_LIBUDEV select BR2_PACKAGE_HAS_UDEV select BR2_PACKAGE_DBUS if !BR2_PACKAGE_DBUS_BROKER # runtime select BR2_PACKAGE_LIBCAP
@@ -104,6 +105,9 @@ menuconfig BR2_PACKAGE_SYSTEMD if BR2_PACKAGE_SYSTEMD +config BR2_PACKAGE_PROVIDES_LIBUDEV + default "systemd" + config BR2_PACKAGE_PROVIDES_UDEV default "systemd"
package/systemd/systemd.mk +1 -1
@@ -60,7 +60,7 @@ SYSTEMD_DEPENDENCIES = \ SYSTEMD_SELINUX_MODULES = systemd udev xdg -SYSTEMD_PROVIDES = udev +SYSTEMD_PROVIDES = libudev udev SYSTEMD_CONF_OPTS += \ -Ddbus=false \
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v9 6/12 package/libudev: make it selectable
In reply to Bernd KuhlsFrom: "Yann E. MORIN" <[email protected]>
Usually, it is not possible for a package to select a virtual package it depends on, and expects a provider to suddenly be available.
However, for libudev, this is slightly simpler: there will be only two providers ever: eudev and systemd. Both are incompatible one with the other, systemd is only available if chosen as an init system.
So, if systemd is not enabled (as an init system), then we can forcefully enable eudev as the provider for libudev.
However, this can cause circular dependencies in Kconfig, du to a rather complex chain of select and depends. For example, when libinput is converting in a later patch, we'd end up with:
package/weston/Config.in:6:error: recursive dependency detected!
package/weston/Config.in:6: symbol BR2_PACKAGE_WESTON depends on BR2_PACKAGE_HAS_UDEV
package/udev/Config.in:1: symbol BR2_PACKAGE_HAS_UDEV is selected by BR2_PACKAGE_EUDEV_DAEMON
package/eudev/Config.in:24: symbol BR2_PACKAGE_EUDEV_DAEMON depends on BR2_PACKAGE_EUDEV
package/eudev/Config.in:1: symbol BR2_PACKAGE_EUDEV is selected by BR2_PACKAGE_LIBUDEV
package/libudev/Config.in:1: symbol BR2_PACKAGE_LIBUDEV is selected by BR2_PACKAGE_LIBINPUT
package/libinput/Config.in:1: symbol BR2_PACKAGE_LIBINPUT is selected by BR2_PACKAGE_WESTON
The root cause being a mis-match of select and depends on in the same chain, where Kconfig can not determine that an external condition will ensure that the chain is in fact broken at some point.
To fix that, we move the symbol for the eudev daemon out of the eudev if-block. This breaks the chain.
Yet, we still want to tell the user that the daemon is enabled, so we introduce a dummy symbol, just for the sake of having a forced-on prompt.
--- package/eudev/Config.in | 25 +++++++++++++++++-------- package/libudev/Config.in | 7 +++++++ 2 files changed, 24 insertions(+), 8 deletions(-)
package/eudev/Config.in +17 -8
@@ -1,3 +1,17 @@ +# This symbol is outside the eudev if-block, so that we do not have +# a circular dependency in kconfig. Thus, we need the dummy symbol, +# below, to inform the user that the daemon has indeed been enabled. +config BR2_PACKAGE_EUDEV_DAEMON + bool + select BR2_PACKAGE_HAS_UDEV + select BR2_PACKAGE_UDEV_GENTOO_SCRIPTS if BR2_INIT_OPENRC + select BR2_PACKAGE_UTIL_LINUX + select BR2_PACKAGE_UTIL_LINUX_LIBS + select BR2_PACKAGE_UTIL_LINUX_LIBBLKID + select BR2_PACKAGE_KMOD + # We can select this has we're sure eudev is selected when we are. + select BR2_PACKAGE_EUDEV_DAEMON_DUMMY + config BR2_PACKAGE_EUDEV bool "eudev" depends on BR2_USE_MMU # uses fork()
@@ -18,19 +32,14 @@ if BR2_PACKAGE_EUDEV config BR2_PACKAGE_PROVIDES_LIBUDEV default "eudev" -config BR2_PACKAGE_EUDEV_DAEMON +config BR2_PACKAGE_EUDEV_DAEMON_DUMMY bool "udev daemon" depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV - select BR2_PACKAGE_HAS_UDEV - select BR2_PACKAGE_UDEV_GENTOO_SCRIPTS if BR2_INIT_OPENRC - select BR2_PACKAGE_UTIL_LINUX - select BR2_PACKAGE_UTIL_LINUX_LIBS - select BR2_PACKAGE_UTIL_LINUX_LIBBLKID - select BR2_PACKAGE_KMOD help Install the udev daemon. -if BR2_PACKAGE_EUDEV_DAEMON +# Use the dummy symbol for proper indetation +if BR2_PACKAGE_EUDEV_DAEMON_DUMMY config BR2_PACKAGE_PROVIDES_UDEV default "eudev"
package/libudev/Config.in +7 -0
@@ -1,3 +1,10 @@ +config BR2_PACKAGE_LIBUDEV + bool + depends on BR2_USE_MMU # eudev / systemd + depends on BR2_USE_WCHAR # eudev / systemd + depends on !BR2_STATIC_LIBS # eudev / systemd + select BR2_PACKAGE_EUDEV if !BR2_PACKAGE_SYSTEMD + config BR2_PACKAGE_HAS_LIBUDEV bool
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v9 7/12 package/qt5base: optionally use libudev
In reply to Bernd KuhlsFrom: "Yann E. MORIN" <[email protected]>
qt5base only requires libudev, not a full udev daemon.
--- package/qt5/qt5base/qt5base.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
package/qt5/qt5base/qt5base.mk +2 -2
@@ -105,8 +105,8 @@ ifneq ($(QT5BASE_CONFIG_FILE),) QT5BASE_CONFIGURE_OPTS += -qconfig buildroot endif -ifeq ($(BR2_PACKAGE_HAS_UDEV),y) -QT5BASE_DEPENDENCIES += udev +ifeq ($(BR2_PACKAGE_HAS_LIBUDEV),y) +QT5BASE_DEPENDENCIES += libudev endif ifeq ($(BR2_PACKAGE_CUPS), y)
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v9 8/12 package/libinput: only needs libudev, not udev daemon
In reply to Bernd KuhlsFrom: "Yann E. MORIN" <[email protected]>
--- package/libinput/Config.in | 10 +++++++--- package/libinput/libinput.mk | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-)
package/libinput/Config.in +7 -3
@@ -1,8 +1,11 @@ config BR2_PACKAGE_LIBINPUT bool "libinput" - depends on BR2_PACKAGE_HAS_UDEV + depends on BR2_USE_MMU # libudev <- eudev/systemd + depends on BR2_USE_WCHAR # libudev <- eudev/systemd + depends on !BR2_STATIC_LIBS # libudev <- eudev/systemd select BR2_PACKAGE_LIBEVDEV select BR2_PACKAGE_MTDEV + select BR2_PACKAGE_LIBUDEV help libinput is a library to handle input devices in Wayland compositors and to provide a generic X.Org input driver.
@@ -35,5 +38,6 @@ config BR2_PACKAGE_LIBINPUT_PYTHON_TOOLS endif -comment "libinput needs udev /dev management" - depends on !BR2_PACKAGE_HAS_UDEV +comment "libinput needs a toolchain w/ wchar, dynamic library" + depends on BR2_USE_MMU + depends on !BR2_USE_WCHAR || BR2_STATIC_LIBS
package/libinput/libinput.mk +1 -1
@@ -7,7 +7,7 @@ LIBINPUT_VERSION = 1.23.0 LIBINPUT_SOURCE = libinput-$(LIBINPUT_VERSION).tar.bz2 LIBINPUT_SITE = https://gitlab.freedesktop.org/libinput/libinput/-/archive/$(LIBINPUT_VERSION) -LIBINPUT_DEPENDENCIES = host-pkgconf libevdev mtdev udev +LIBINPUT_DEPENDENCIES = host-pkgconf libevdev mtdev libudev LIBINPUT_INSTALL_STAGING = YES LIBINPUT_LICENSE = MIT LIBINPUT_LICENSE_FILES = COPYING
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v9 9/12 package/kodi: only needs libudev, not udev daemon
In reply to Bernd KuhlsFrom: Bernd Kuhls <[email protected]>
--- package/kodi/Config.in | 4 ++-- package/kodi/kodi.mk | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
package/kodi/Config.in +2 -2
@@ -24,8 +24,8 @@ config BR2_PACKAGE_KODI_PLATFORM_SUPPORTS_GBM depends on BR2_PACKAGE_HAS_LIBGL || BR2_PACKAGE_HAS_LIBGLES depends on BR2_PACKAGE_HAS_LIBGBM depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF - depends on BR2_PACKAGE_HAS_UDEV # libinput select BR2_PACKAGE_KODI_PLATFORM_SUPPORTS + select BR2_PACKAGE_LIBUDEV comment "kodi needs udev support for gbm" depends on !BR2_PACKAGE_KODI_PLATFORM_SUPPORTS
@@ -252,7 +252,7 @@ config BR2_PACKAGE_KODI_LIBUSB bool "usb" # https://github.com/xbmc/xbmc/blob/Jarvis/configure.ac#L1554 # "if libudev is available, we don't need libusb" - depends on !BR2_PACKAGE_HAS_UDEV + depends on !BR2_PACKAGE_HAS_LIBUDEV select BR2_PACKAGE_LIBUSB select BR2_PACKAGE_LIBUSB_COMPAT help
package/kodi/kodi.mk +2 -2
@@ -221,9 +221,9 @@ else KODI_CONF_OPTS += -DENABLE_MYSQLCLIENT=OFF endif -ifeq ($(BR2_PACKAGE_HAS_UDEV),y) +ifeq ($(BR2_PACKAGE_HAS_LIBUDEV),y) KODI_CONF_OPTS += -DENABLE_UDEV=ON -KODI_DEPENDENCIES += udev +KODI_DEPENDENCIES += libudev else KODI_CONF_OPTS += -DENABLE_UDEV=OFF ifeq ($(BR2_PACKAGE_KODI_LIBUSB),y)
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v9 10/12 package/libv4l: optionally use libudev
In reply to Bernd KuhlsFrom: Bernd Kuhls <[email protected]>
libv4l only requires libudev, not a full udev daemon.
--- package/libv4l/libv4l.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
package/libv4l/libv4l.mk +2 -2
@@ -44,9 +44,9 @@ ifeq ($(BR2_PACKAGE_HAS_LIBGL),y) LIBV4L_DEPENDENCIES += libgl endif -ifeq ($(BR2_PACKAGE_HAS_UDEV),y) +ifeq ($(BR2_PACKAGE_HAS_LIBUDEV),y) LIBV4L_CONF_OPTS += --with-libudev --with-udevdir=/usr/lib/udev -LIBV4L_DEPENDENCIES += udev +LIBV4L_DEPENDENCIES += libudev else LIBV4L_CONF_OPTS += --without-libudev endif
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v9 11/12 package/libcec: optionally use libudev
In reply to Bernd KuhlsFrom: Bernd Kuhls <[email protected]>
libcec only requires libudev, not a full udev daemon.
--- package/libcec/libcec.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
package/libcec/libcec.mk +2 -2
@@ -16,8 +16,8 @@ ifeq ($(BR2_PACKAGE_LOCKDEV),y) LIBCEC_DEPENDENCIES += lockdev endif -ifeq ($(BR2_PACKAGE_HAS_UDEV),y) -LIBCEC_DEPENDENCIES += udev +ifeq ($(BR2_PACKAGE_HAS_LIBUDEV),y) +LIBCEC_DEPENDENCIES += libudev endif ifeq ($(BR2_PACKAGE_PYTHON3),y)
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v9 12/12 package/usbutils: only needs libudev, not udev daemon
In reply to Bernd KuhlsFrom: Bernd Kuhls <[email protected]>
--- package/usbutils/Config.in | 12 +++++++++--- package/usbutils/usbutils.mk | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-)
package/usbutils/Config.in +9 -3
@@ -2,14 +2,20 @@ config BR2_PACKAGE_USBUTILS bool "usbutils" depends on BR2_TOOLCHAIN_HAS_THREADS # libusb depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # libusb - depends on BR2_PACKAGE_HAS_UDEV # needs hwdb + depends on BR2_USE_MMU # libudev <- eudev/systemd + depends on BR2_USE_WCHAR # libudev <- eudev/systemd + depends on !BR2_STATIC_LIBS # libudev <- eudev/systemd + select BR2_PACKAGE_EUDEV_ENABLE_HWDB if BR2_PACKAGE_EUDEV + select BR2_PACKAGE_SYSTEMD_HWDB if BR2_PACKAGE_SYSTEMD + select BR2_PACKAGE_LIBUDEV select BR2_PACKAGE_LIBUSB help USB enumeration utilities http://linux-usb.sourceforge.net/ -comment "usbutils needs udev /dev management and toolchain w/ threads, gcc >= 4.9" +comment "usbutils needs a toolchain w/ threads, wchar, dynamic library, gcc >= 4.9" + depends on BR2_USE_MMU depends on !BR2_TOOLCHAIN_HAS_THREADS || \ - !BR2_PACKAGE_HAS_UDEV || \ + !BR2_USE_WCHAR || BR2_STATIC_LIBS || \ !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
package/usbutils/usbutils.mk +1 -1
@@ -7,7 +7,7 @@ USBUTILS_VERSION = 015 USBUTILS_SOURCE = usbutils-$(USBUTILS_VERSION).tar.xz USBUTILS_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/usb/usbutils -USBUTILS_DEPENDENCIES = host-pkgconf libusb udev +USBUTILS_DEPENDENCIES = host-pkgconf libudev libusb USBUTILS_LICENSE = GPL-2.0+ (utils) GPL-2.0 or GPL-3.0 (lsusb.py) USBUTILS_LICENSE_FILES = LICENSES/GPL-2.0-only.txt LICENSES/GPL-3.0-only.txt
Signature · 6 lines
2.39.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hello,
Quoted 6 lines · On Sun, 6 Aug 2023 16:02:29 +0200 Bernd Kuhls <[email protected]> wrote:
Bernd Kuhls (4):
package/kodi: only needs libudev, not udev daemon package/libv4l: optionally use libudev package/libcec: optionally use libudev package/usbutils: only needs libudev, not udev daemon
Quoted 9 lines
Yann E. MORIN (8):
package/eudev: add option to enable the udev daemon package/eudev: allow building only the library package/libudev: new virtual package package/eudev: provides libudev package/systemd: provides libudev package/libudev: make it selectable package/qt5base: optionally use libudev package/libinput: only needs libudev, not udev daemon
Thanks Bernd for working on this. I didn't look carefully at the patches in this iteration, but I remember looking at previous iterations, and it was good.
I just wanted to question the relevance of this, so I did a quick experiment. I applied just patches 1 and 2 of this patch series, which allow to build eudev with and without the daemon. Then I built two defconfigs:
BR2_arm=y
BR2_cortex_a9=y
BR2_ARM_ENABLE_VFP=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
BR2_INIT_NONE=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
# BR2_PACKAGE_EUDEV_ENABLE_HWDB is not set
# BR2_TARGET_ROOTFS_TAR is not set
which enables the full eudev (daemon included)
And:
BR2_arm=y
BR2_cortex_a9=y
BR2_ARM_ENABLE_VFP=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_EUDEV=y
# BR2_PACKAGE_EUDEV_ENABLE_HWDB is not set
# BR2_TARGET_ROOTFS_TAR is not set
which enables only libudev.
The first defconfig generates an output/target/ of 7.4 MB, the second defconfig generates an output/target/ of 5.4 MB.
In the first defconfig, the eudev package takes 1.69 MB, and the util-linux-libs package takes 330 KB.
In the second defconfig, the eudev package takes 133 KB, and util-linux-libs is not needed.
So in this "extreme" example, it saves 2 MB. I say "extreme" because a realistic rootfs will have something that uses libudev and is going to be bigger. util-linux-libs is used by a *lot* of system-level packages, so it's relatively likely that it's going to be pulled in by some other packages in most typical configurations. The size of eudev could be reduced locally via post-build script.
I want to see if we really want to add this additional complexity of a virtual package "just" to save 2 MB. I don't have a very strong opinion on this so I could be convinced either way, but I find the extra complexity quite high compared to the usefulness for most typical use-cases.
Arnout, Peter, could you give your opinion here so that we can take a decision, and either merge this patch series or reject it?
Thanks!
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
A message that is not in the archive (sent off-list or not yet received): 20230822225949.2b326664__48539.150941518$1692738023$gmane$org@windsurf
Am Tue, 22 Aug 2023 22:59:49 +0200 schrieb Thomas Petazzoni via buildroot:
Quoted 8 lines
I just wanted to question the relevance of this
The first defconfig generates an output/target/ of 7.4 MB, the second defconfig generates an output/target/ of 5.4 MB.
I don't have a very strong opinion on this so I could be convinced either way, but I find the extra complexity quite high compared to the usefulness for most typical use-cases.
Hi Thomas,
the reason I am carrying this patch in my personal tree is maintenance of a buildroot-based system which uses
BR2_ROOTFS_DEVICE_CREATION_STATIC=y
Without the libudev series I can not use packages like Kodi, and no, I can not change the rootfs setting for this system, sorry.
Regards, Bernd
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hello Bernd,
Quoted 7 lines · On Fri, 25 Aug 2023 18:24:41 +0200 Bernd Kuhls <[email protected]> wrote:
the reason I am carrying this patch in my personal tree is maintenance of a buildroot-based system which uses
BR2_ROOTFS_DEVICE_CREATION_STATIC=y
Without the libudev series I can not use packages like Kodi, and no, I can not change the rootfs setting for this system, sorry.
So you can apply complicated patches/changes, but you cannot adjust the configuration of your system to use eudev? This does not really sound like a very good/solid argument in favor of this patch series :-/
Especially when you have Kodi, the size difference between "just libudev" and "libudev + eudev" is insignificant compared to the size of Kodi.
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Am Fri, 25 Aug 2023 19:05:32 +0200 schrieb Thomas Petazzoni via buildroot:
Quoted 2 lines
So you can apply complicated patches/changes, but you cannot adjust the configuration of your system to use eudev?
Hi,
the init scripts of this system were created outside of buildroot and need a statically-populated /dev. As I said, changing the configuration is not possible, sorry.
Due to upstream now supporting a daemon-less build I thought I try again to get this series into buildroot. One of your arguments from 2016 was the lack of upstream support for this feature:
https://lists.buildroot.org/pipermail/buildroot/2016-July/470285.html
We do not need to trick-around with the build system anymore, we just add an option to build the package in a way which is supported by upstream now.
Regards, Bernd
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot