All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/5 RFC] Introduce libudev (branch yem/libudev)
@ 2014-06-11 23:40 Yann E. MORIN
  2014-06-11 23:40 ` [Buildroot] [PATCH 1/5 RFC] package/eudev: remove the prompt Yann E. MORIN
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-06-11 23:40 UTC (permalink / raw)
  To: buildroot

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

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

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/5 RFC] package/eudev: remove the prompt
  2014-06-11 23:40 [Buildroot] [PATCH 0/5 RFC] Introduce libudev (branch yem/libudev) Yann E. MORIN
@ 2014-06-11 23:40 ` Yann E. MORIN
  2014-06-11 23:40 ` [Buildroot] [PATCH 2/5 RFC] package/systemd: remove prompt Yann E. MORIN
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-06-11 23:40 UTC (permalink / raw)
  To: buildroot

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

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! ;-)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/eudev/Config.in | 30 +++++++++---------------------
 system/Config.in        | 21 ++++++++++++++++-----
 2 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/package/eudev/Config.in b/package/eudev/Config.in
index 40ff721..b204a90 100644
--- a/package/eudev/Config.in
+++ b/package/eudev/Config.in
@@ -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
diff --git a/system/Config.in b/system/Config.in
index 53bca53..2305de2 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -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
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/5 RFC] package/systemd: remove prompt
  2014-06-11 23:40 [Buildroot] [PATCH 0/5 RFC] Introduce libudev (branch yem/libudev) Yann E. MORIN
  2014-06-11 23:40 ` [Buildroot] [PATCH 1/5 RFC] package/eudev: remove the prompt Yann E. MORIN
@ 2014-06-11 23:40 ` Yann E. MORIN
  2014-06-11 23:40 ` [Buildroot] [PATCH 3/5 RFC] package/libudev: new virtual package Yann E. MORIN
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-06-11 23:40 UTC (permalink / raw)
  To: buildroot

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

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! ;-)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/systemd/Config.in | 53 ++++++++++++++------------------------------
 system/Config.in          | 56 ++++++++++++++++++++++++++++++++++++++---------
 2 files changed, 63 insertions(+), 46 deletions(-)

diff --git a/package/systemd/Config.in b/package/systemd/Config.in
index 58f76a5..7ff36cc 100644
--- a/package/systemd/Config.in
+++ b/package/systemd/Config.in
@@ -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
diff --git a/system/Config.in b/system/Config.in
index 2305de2..6f71598 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -87,17 +87,53 @@ config BR2_INIT_SYSV
 
 config BR2_INIT_SYSTEMD
 	bool "systemd"
-	depends on BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS
-	depends on BR2_TOOLCHAIN_USES_GLIBC
-	depends on BR2_LARGEFILE
-	depends on BR2_USE_WCHAR
-	depends on BR2_INET_IPV6
-	depends on BR2_TOOLCHAIN_HAS_THREADS
-	depends on BR2_TOOLCHAIN_HAS_SSP
-	depends on BR2_USE_MMU
-	depends on !BR2_PREFER_STATIC_LIB
-	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8
+	depends on BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS # systemd
+	depends on BR2_TOOLCHAIN_USES_GLIBC # systemd
+	depends on BR2_INET_IPV6 # systemd
+	depends on BR2_TOOLCHAIN_HAS_SSP # systemd
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8 # systemd
+	depends on BR2_LARGEFILE # systemd (util-linux)
+	depends on BR2_USE_WCHAR # systemd (util-linux)
+	depends on !BR2_PREFER_STATIC_LIB # systemd (kmod)
+	depends on BR2_TOOLCHAIN_HAS_THREADS # systemd (dbus)
+	depends on BR2_USE_MMU # systemd (dbus)
 	select BR2_PACKAGE_SYSTEMD
+        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.
+
+	  You can further configure systemd in:
+	    Target packages --> System tools --> systemd
+
+	  http://freedesktop.org/wiki/Software/systemd
 
 comment 'systemd needs an (e)glibc toolchain, headers >= 3.8'
 	depends on !(BR2_TOOLCHAIN_USES_GLIBC \
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 3/5 RFC] package/libudev: new virtual package
  2014-06-11 23:40 [Buildroot] [PATCH 0/5 RFC] Introduce libudev (branch yem/libudev) Yann E. MORIN
  2014-06-11 23:40 ` [Buildroot] [PATCH 1/5 RFC] package/eudev: remove the prompt Yann E. MORIN
  2014-06-11 23:40 ` [Buildroot] [PATCH 2/5 RFC] package/systemd: remove prompt Yann E. MORIN
@ 2014-06-11 23:40 ` Yann E. MORIN
  2014-06-11 23:40 ` [Buildroot] [PATCH 4/5 RFC] package/udev: is a provider for libudev Yann E. MORIN
  2014-06-11 23:40 ` [Buildroot] [PATCH 5/5 RFC] package/eudev: split udev/libudev Yann E. MORIN
  4 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-06-11 23:40 UTC (permalink / raw)
  To: buildroot

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

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.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 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

diff --git a/package/Config.in b/package/Config.in
index 35e088d..6555e08 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -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"
diff --git a/package/libudev/Config.in b/package/libudev/Config.in
new file mode 100644
index 0000000..2745fcc
--- /dev/null
+++ b/package/libudev/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HAS_LIBUDEV
+	bool
+
+config BR2_PACKAGE_PROVIDES_LIBUDEV
+	depends on BR2_PACKAGE_HAS_LIBUDEV
+	string
diff --git a/package/libudev/libudev.mk b/package/libudev/libudev.mk
new file mode 100644
index 0000000..af1b3dd
--- /dev/null
+++ b/package/libudev/libudev.mk
@@ -0,0 +1,7 @@
+################################################################################
+#
+# libudev
+#
+################################################################################
+
+$(eval $(virtual-package))
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 4/5 RFC] package/udev: is a provider for libudev
  2014-06-11 23:40 [Buildroot] [PATCH 0/5 RFC] Introduce libudev (branch yem/libudev) Yann E. MORIN
                   ` (2 preceding siblings ...)
  2014-06-11 23:40 ` [Buildroot] [PATCH 3/5 RFC] package/libudev: new virtual package Yann E. MORIN
@ 2014-06-11 23:40 ` Yann E. MORIN
  2014-06-11 23:40 ` [Buildroot] [PATCH 5/5 RFC] package/eudev: split udev/libudev Yann E. MORIN
  4 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-06-11 23:40 UTC (permalink / raw)
  To: buildroot

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

Rather than having both eudev and systemd be providers of libudev,
any package providing a udev daemon is a provider of libudev, too.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/udev/Config.in | 4 ++++
 package/udev/udev.mk   | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/package/udev/Config.in b/package/udev/Config.in
index 941a515..1aaec6f 100644
--- a/package/udev/Config.in
+++ b/package/udev/Config.in
@@ -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
diff --git a/package/udev/udev.mk b/package/udev/udev.mk
index cc4a6e3..811951d 100644
--- a/package/udev/udev.mk
+++ b/package/udev/udev.mk
@@ -4,4 +4,6 @@
 #
 ################################################################################
 
+UDEV_PROVIDES = libudev
+
 $(eval $(virtual-package))
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 5/5 RFC] package/eudev: split udev/libudev
  2014-06-11 23:40 [Buildroot] [PATCH 0/5 RFC] Introduce libudev (branch yem/libudev) Yann E. MORIN
                   ` (3 preceding siblings ...)
  2014-06-11 23:40 ` [Buildroot] [PATCH 4/5 RFC] package/udev: is a provider for libudev Yann E. MORIN
@ 2014-06-11 23:40 ` Yann E. MORIN
  4 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-06-11 23:40 UTC (permalink / raw)
  To: buildroot

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

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! :-)

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

---
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(-)

diff --git a/package/Config.in b/package/Config.in
index 6555e08..534b848 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -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"
diff --git a/package/eudev/Config.in b/package/eudev/Config.in
index b204a90..6d7a6d2 100644
--- a/package/eudev/Config.in
+++ b/package/eudev/Config.in
@@ -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
diff --git a/package/eudev/eudev.mk b/package/eudev/eudev.mk
index 5f1525c..aadc37c 100644
--- a/package/eudev/eudev.mk
+++ b/package/eudev/eudev.mk
@@ -16,19 +16,27 @@ EUDEV_CONF_ENV += LIBS=-lrt
 
 EUDEV_CONF_OPT =		\
 	--disable-manpages	\
-	--sbindir=/sbin		\
 	--with-rootlibdir=/lib	\
 	--libexecdir=/lib	\
 	--with-firmware-path=/lib/firmware	\
 	--disable-introspection			\
-	--enable-split-usr			\
-	--enable-libkmod
+	--enable-split-usr
+
+EUDEV_DEPENDENCIES = host-pkgconf
+
+ifeq ($(BR2_PACKAGE_EUDEV_DAEMON),y)
 
-EUDEV_DEPENDENCIES = host-gperf host-pkgconf util-linux kmod
+EUDEV_DEPENDENCIES += host-gperf util-linux kmod
 EUDEV_PROVIDES = udev
 
+EUDEV_CONF_OPT += \
+	--sbindir=/sbin \
+	--enable-libkmod
+
 ifeq ($(BR2_PACKAGE_EUDEV_RULES_GEN),y)
 EUDEV_CONF_OPT += --enable-rule_generator
+else
+EUDEV_CONF_OPT += --disable-rule_generator
 endif
 
 ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
@@ -42,4 +50,34 @@ define EUDEV_INSTALL_INIT_SYSV
 	$(INSTALL) -m 0755 package/eudev/S10udev $(TARGET_DIR)/etc/init.d/S10udev
 endef
 
+else # ! daemon
+
+EUDEV_PROVIDES = libudev
+
+EUDEV_CONF_OPT += \
+	--disable-keymap \
+	--disable-libkmod \
+	--disable-modules \
+	--disable-selinux \
+	--disable-rule-generator \
+	--disable-gtk-doc \
+	--disable-gudev
+
+# When not installing the daemon, we have to override the build and install
+# commands, to just install the library.
+
+define EUDEV_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/src/libudev
+endef
+
+define EUDEV_INSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/src/libudev DESTDIR=$(STAGING_DIR) install
+endef
+
+define EUDEV_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/src/libudev DESTDIR=$(TARGET_DIR) install
+endef
+
+endif # ! daemon
+
 $(eval $(autotools-package))
diff --git a/system/Config.in b/system/Config.in
index 6f71598..37f596a 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -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/
 
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-06-11 23:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-11 23:40 [Buildroot] [PATCH 0/5 RFC] Introduce libudev (branch yem/libudev) Yann E. MORIN
2014-06-11 23:40 ` [Buildroot] [PATCH 1/5 RFC] package/eudev: remove the prompt Yann E. MORIN
2014-06-11 23:40 ` [Buildroot] [PATCH 2/5 RFC] package/systemd: remove prompt Yann E. MORIN
2014-06-11 23:40 ` [Buildroot] [PATCH 3/5 RFC] package/libudev: new virtual package Yann E. MORIN
2014-06-11 23:40 ` [Buildroot] [PATCH 4/5 RFC] package/udev: is a provider for libudev Yann E. MORIN
2014-06-11 23:40 ` [Buildroot] [PATCH 5/5 RFC] package/eudev: split udev/libudev Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.