Skip to contentSkip to conversation

Introduce libudev (branch yem/libudev)

RFC PATCH Superseded Yann E. MORIN 4 participants 34 messages Jun 13, 2014 – Jul 11, 2014

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v2 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 contains:

- a patch to remove a spurious dependency on udev for XBMC

- three patches to fix generating the list of virtual packages for the manual

- two 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

- a patch to intrduce the libudev virtual package

- two patches to add libudev providers: eudev and systemd

- a patch to make eudev only build libudev if /dev management is handled by neither eudev nor systemd

- ten patches to convert packages to depend on libusb instead of a udev daemon

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.

Also, the converted packages have not been tested, not even build-tested; this is just an RFC to validate the overal solution for now.

On your keyboards, get set, ready... Comment! :-)

Changes RFCv1 -> RFCv2:
- have eudev and systemd be providers for libudev, instead of having udev be the provider (Thomas, on IRC)
- fix the manual lists after bugs were uncovered with the removal of the eudev and systemd prompts
- convert some packages

Regards,
Yann E. MORIN.

The following changes since commit 712414ce2dc6f40ed98a3d8007e7d7ec382f79d4:

gcc: drop redundant explicit version handling for aarch64 (2014-06-13 23:01:16 +0200)

are available in the git repository at:

git://gitorious.org/buildroot/buildroot.git yem/libudev

for you to fetch changes up to bc3939ee063e015da15063492b6ef0d0b1b7a6de:

package/xserver_xorg-server: needs libudev, not a udev daemon (2014-06-14 00:47:52 +0200)

----------------------------------------------------------------
Yann E. MORIN (20):
package/xbmc: remove spurious build-dependency on udev support/gen-manual-lists.py: remove unneeded arg in private function support/gen-manual-lists.py: bail out early for legacy symbols support/gen-manual-lists.py: rework generating the virtual package list package/eudev: remove the prompt
package/systemd: remove prompt
package/libudev: new virtual package
package/eudev: is a provider for libudev
package/systemd: is a provider for libudev
package/eudev: split udev/libudev
package/libatasmart: needs libudev, not a udev daemon package/libcec: needs libudev, not a udev daemon package/libdrm: can also use only libudev
package/libinput: needs libudev, not a udev daemon package/libusb: needs libudev, not a udev daemon package/mesa3d: depends on libudev, not udev
package/vlc: needs libudev, not a udev daemon package/weston: needs libudev, not a udev daemon package/xdriver_xf86-input-evdev: needs libudev, not a udev daemon package/xserver_xorg-server: needs libudev, not a udev daemon

 package/Config.in                                  |  3 +-
 package/eudev/Config.in                            | 68 +++++++++++-----
 package/eudev/eudev.mk                             | 47 +++++++++--
 package/libatasmart/Config.in                      |  2 +-
 package/libcec/libcec.mk                           |  4 +-
 package/libdrm/libdrm.mk                           |  4 +
 package/libinput/Config.in                         |  5 +-
 package/libinput/libinput.mk                       |  2 +-
 package/libudev/Config.in                          |  6 ++
 package/libudev/libudev.mk                         |  7 ++
 package/libusb/libusb.mk                           |  5 +-
 package/mesa3d/Config.in                           |  2 +-
 package/mesa3d/mesa3d.mk                           |  4 +-
 package/systemd/Config.in                          | 55 +++++--------
 package/systemd/systemd.mk                         |  2 +-
 package/vlc/vlc.mk                                 |  4 +-
 package/weston/Config.in                           |  6 +-
 package/weston/weston.mk                           |  2 +-
 package/x11r7/xdriver_xf86-input-evdev/Config.in   |  5 +-
 .../xdriver_xf86-input-evdev.mk                    |  3 +-
 .../xserver_xorg-server/xserver_xorg-server.mk     |  4 +-
 package/xbmc/Config.in                             |  6 +-
 package/xbmc/xbmc.mk                               |  2 +-
 support/scripts/gen-manual-lists.py                | 92 ++++++++++++++++++----
 system/Config.in                                   | 76 ++++++++++++++----
 25 files changed, 294 insertions(+), 122 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.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

RFC PATCH v2 1/20 package/xbmc: remove spurious build-dependency on udev

From: "Yann E. MORIN" <[email protected]>

CEC support with libcec needs udev, but it is the responsibility of libcec to have proper build-dependencies, not XBMC.

So, just remove the spurious dependency on udev in XBMC.

---
 package/xbmc/xbmc.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/xbmc/xbmc.mk +1 -1
index 1d458d4..45be990 100644
@@ -130,7 +130,7 @@ XBMC_CONF_OPT += --disable-avahi
 endif
 
 ifeq ($(BR2_PACKAGE_XBMC_LIBCEC),y)
-XBMC_DEPENDENCIES += libcec udev
+XBMC_DEPENDENCIES += libcec
 XBMC_CONF_OPT += --enable-libcec
 else
 XBMC_CONF_OPT += --disable-libcec
Signature · 1 line
1.8.3.2
#3 lore raw

RFC PATCH v2 2/20 support/gen-manual-lists.py: remove unneeded arg in private function

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

No need to pass as argument to a function, members of the class it's in.

---
 support/scripts/gen-manual-lists.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
support/scripts/gen-manual-lists.py +3 -3
index 69f4c7e..483b384 100644
@@ -384,7 +384,7 @@ class Buildroot:
                     return s
             return None
 
-        def _get_providers(config, symbol):
+        def _get_providers(symbol):
             providers = list()
             for sym in self.config:
                 if not sym.is_symbol():
@@ -404,7 +404,7 @@ class Buildroot:
                                   + " (w/ " + l + ")"
                             providers.append(l)
                         else:
-                            providers.extend(_get_providers(config,sym))
+                            providers.extend(_get_providers(sym))
             return providers
 
         if what == "layout":
@@ -415,7 +415,7 @@ class Buildroot:
 
         if what == "symbol":
             pkg = re.sub(r"^BR2_PACKAGE_HAS_(.+)$", r"\1", symbol.get_name())
-            providers = _get_providers(self.config, symbol)
+            providers = _get_providers(symbol)
 
             return "| {0:<20} <| {1:<32} <| {2}\n".format(pkg.lower(),
                                                           '+' + symbol.get_name() + '+',
Signature · 1 line
1.8.3.2
#5 lore raw

RFC PATCH v2 3/20 support/gen-manual-lists.py: bail out early for legacy symbols

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

When searching for virtual package providers, there's no need to handle legacy symbols at all, so just bail out early.

---
 support/scripts/gen-manual-lists.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
support/scripts/gen-manual-lists.py +2 -2
index 483b384..95c10dc 100644
@@ -389,13 +389,13 @@ class Buildroot:
             for sym in self.config:
                 if not sym.is_symbol():
                     continue
+                if _symbol_is_legacy(sym):
+                    continue
                 selects = sym.get_selected_symbols()
                 if not selects:
                     continue
                 for s in selects:
                     if s == symbol:
-                        if _symbol_is_legacy(sym):
-                            continue
                         if sym.prompts:
                             l = self._get_symbol_label(sym,False)
                             parent_pkg = _get_parent_package(sym)
Signature · 1 line
1.8.3.2
#6 lore raw

RFC PATCH 3/20 support/gen-manual-lists.py: bail out early for legacy symbols

Yann,

Quoted 4 lines · Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

When searching for virtual package providers, there's no need to handle legacy symbols at all, so just bail out early.

Do forget your SoB line ;-) and you can add my ack too :)

#7 lore raw

RFC PATCH v2 4/20 support/gen-manual-lists.py: rework generating the virtual package list

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

Tog et the list of providers of a virtual pacakge, we currently scan all the symbols to see if they select the virtual package _HAS symbol.

Then, for all such selecting symbols, we iterate tthrough the select chain, to the uppermostsymbol that has a prompt, to get the actual user-selectable symbol that ultimately will select the virtual package. This handles blind symbols that are options to a package.

So far, this is working relatively OK, except we do not account for a special type of providers: virtual packages.

There is nothing that prevent a virtual package to declare itself as a provider for another virtual package.

This will be the case for udev, a virtual package provided by eudev or systemd, but also a provider of the virtual package libudev.

Additionally, another case that is not handled is actual packages that are actually promptless. So far, we expected symbols with no prompt to be an option to a package, and we would ultimately (via the backward select recursion, above) end up finding a package symbol with a prompt.

But we're soon removing the prompts of eudev and systemd [*], so the previosuly valid heuristic is no longer valid.

So, we need a brand-new heuristic to build up the list of providers.

Fortunately, instead of _blindly_ looking for selecting symbols, we can actually extract the providign packages from the list of 'default' values of the _PROVIDES_XXX symbol. This gives us the list of packages, but not sub-options.

Then, we can go on hunting for any selecting symbol. Each such symbol that is not a known package gets treated like an option, as was done up until now.

What this additional complexity brings, is that prompt-less packages are automatically found, from the list of 'default' values, and this includes real prompt-less pacakges, as well as virtual packages. This is what we were missing previously.

[*] because they are not directly user-selectable, see the corresponding following changesets for the rationale.

---
 support/scripts/gen-manual-lists.py | 88 +++++++++++++++++++++++++++++++------
 1 file changed, 74 insertions(+), 14 deletions(-)
support/scripts/gen-manual-lists.py +74 -14
index 95c10dc..837cd66 100644
@@ -384,28 +384,88 @@ class Buildroot:
                     return s
             return None
 
+        # This function returns a list of providers for the specified symbol.
+        # 'symbol' must be a _HAS_XXX symbol.
+        # Each element is a string.
+        # Each element is the name of the providing package, with any
+        # sub-option of that package.
+        # E.g.:  "rpi-userland"   "mesa3d (w/ OpenGL ES)"
+        #
+        # We consider the provider packages by looking at all the defaul "foo"
+        # for the corresponding _PROVIDES_XXX symbol, which gives us all the
+        # packages.
+        # Then we look at all the symbols that 'select' the _HAS_XXX symbol.
+        # If a selecting symbol is also a package symbol, this is a cut.
+        # Otherwise, we iterate the 'sected by' chain until we find a symbol
+        # with a prompt, which we consider the enabling sub-option, or we end
+        # up with the providing-package's symbol.
         def _get_providers(symbol):
-            providers = list()
+            providers_syms = list()
+            providers_syms_w_opts = list()
+
+            # Get all providing packages
+            _provides_pkg = re.sub(r"^(BR2_PACKAGE)_HAS_(.+)$",
+                                   r"\1_PROVIDES_\2",
+                                   symbol.get_name())
+            _provides_sym = self.config.get_symbol(_provides_pkg)
+            for (p,_) in _provides_sym.def_exprs:
+                _p = self.config._expr_val_str(p, get_val_instead_of_eval=True)
+                _p = re.sub(r"-",r"_",_p.strip('"'))
+                providers_syms.append(self.config.get_symbol("BR2_PACKAGE_"+_p.upper()))
+
+            # Now, try to get sub-options
+            # Iterate across all symbols, to see if any selects us
+            for sym in _get_selecting_symbols_with_prompt(symbol):
+                if _symbol_is_legacy(sym):
+                    continue
+                if sym in providers_syms:
+                    # The symbol is a package that provides us, and we already
+                    # know of it
+                    continue
+                # The symbol is unknown, we suppose it is an option, so find
+                # the package it comes from
+                parent_pkg = _get_parent_package(sym)
+                if parent_pkg is not None:
+                    providers_syms_w_opts.append( (parent_pkg,sym) )
+
+            # Now, build a list of providers with option
+            seen = list()
+            providers_str = list()
+            for (p,o) in providers_syms_w_opts:
+                if not p in seen:
+                    seen.append(p)
+                l = self._get_symbol_label(p,False) + " (w/ " \
+                  + self._get_symbol_label(o,False) + ")"
+                providers_str.append(l)
+
+            # Finally, complete with the list of providers without option
+            for p in providers_syms:
+                if p in seen:
+                    continue
+                _p = re.sub(r"^BR2_PACKAGE_(.*)", r"\1", p.get_name()).lower()
+                providers_str.append(_p)
+
+            return providers_str
+
+        # This functions return a list of all symbols that have a prompt,
+        # and that 'select' the given symbol
+        def _get_selecting_symbols_with_prompt(symbol):
+            syms = list()
             for sym in self.config:
                 if not sym.is_symbol():
                     continue
-                if _symbol_is_legacy(sym):
-                    continue
                 selects = sym.get_selected_symbols()
                 if not selects:
                     continue
+                # Does this symbol selects us?
                 for s in selects:
-                    if s == symbol:
-                        if sym.prompts:
-                            l = self._get_symbol_label(sym,False)
-                            parent_pkg = _get_parent_package(sym)
-                            if parent_pkg is not None:
-                                l = self._get_symbol_label(parent_pkg, False) \
-                                  + " (w/ " + l + ")"
-                            providers.append(l)
-                        else:
-                            providers.extend(_get_providers(sym))
-            return providers
+                    if not s == symbol:
+                        continue
+                    if sym.prompts:
+                        syms.append(sym)
+                    else:
+                        syms.extend(_get_selecting_symbols_with_prompt(sym))
+            return syms
 
         if what == "layout":
             return ( "100%", "^1,4,4" )
Signature · 1 line
1.8.3.2
#8 lore raw

RFC PATCH 4/20 support/gen-manual-lists.py: rework generating the virtual package list

Yann,

Quoted 3 lines · Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

Tog et the list of providers of a virtual pacakge, we currently scan

s/Tog et/To get/
s/pacakge/package/

Quoted 3 lines

all the symbols to see if they select the virtual package _HAS symbol.

Then, for all such selecting symbols, we iterate tthrough the select

s/tthrough/through/

Quoted 1 line

chain, to the uppermostsymbol that has a prompt, to get the actual

s/to the/to find the/
s/uppermostsymbol/uppermost symbol/

Quoted 12 lines

user-selectable symbol that ultimately will select the virtual package. This handles blind symbols that are options to a package.

So far, this is working relatively OK, except we do not account for a special type of providers: virtual packages.

There is nothing that prevent a virtual package to declare itself as a provider for another virtual package.

This will be the case for udev, a virtual package provided by eudev or systemd, but also a provider of the virtual package libudev.

Quoted 7 lines

Additionally, another case that is not handled is actual packages that are actually promptless. So far, we expected symbols with no prompt to be an option to a package, and we would ultimately (via the backward select recursion, above) end up finding a package symbol with a prompt.

But we're soon removing the prompts of eudev and systemd [*], so the previosuly valid heuristic is no longer valid.

s/previosuly/previously/

Quoted 5 lines

So, we need a brand-new heuristic to build up the list of providers.

Fortunately, instead of _blindly_ looking for selecting symbols, we can actually extract the providign packages from the list of 'default'

s/providign/providing/

Quoted 10 lines

values of the _PROVIDES_XXX symbol. This gives us the list of packages, but not sub-options.

Then, we can go on hunting for any selecting symbol. Each such symbol that is not a known package gets treated like an option, as was done up until now.

What this additional complexity brings, is that prompt-less packages are automatically found, from the list of 'default' values, and this includes real prompt-less pacakges, as well as virtual packages. This

s/pacakges/packages/

Quoted 16 lines

is what we were missing previously.

[*] because they are not directly user-selectable, see the corresponding following changesets for the rationale.

---
 support/scripts/gen-manual-lists.py | 88 +++++++++++++++++++++++++++++++------
 1 file changed, 74 insertions(+), 14 deletions(-)
support/scripts/gen-manual-lists.py +0 -0
index 95c10dc..837cd66 100644
@@ -384,28 +384,88 @@ class Buildroot:
                     return s

support/scripts/gen-manual-lists.py class Buildroot: · line 394

Quoted 10 lines
support/scripts/gen-manual-lists.py +8 -0
             return None
 
+        # This function returns a list of providers for the specified symbol.
+        # 'symbol' must be a _HAS_XXX symbol.
+        # Each element is a string.
+        # Each element is the name of the providing package, with any
+        # sub-option of that package.
+        # E.g.:  "rpi-userland"   "mesa3d (w/ OpenGL ES)"
+        #
+        # We consider the provider packages by looking at all the defaul "foo"

s/defaul/default/

support/scripts/gen-manual-lists.py class Buildroot: · line 399

Quoted 5 lines
support/scripts/gen-manual-lists.py +5 -0
+        # for the corresponding _PROVIDES_XXX symbol, which gives us all the
+        # packages.
+        # Then we look at all the symbols that 'select' the _HAS_XXX symbol.
+        # If a selecting symbol is also a package symbol, this is a cut.
+        # Otherwise, we iterate the 'sected by' chain until we find a symbol

s/sected by/selected by/

support/scripts/gen-manual-lists.py class Buildroot: · line 411

Quoted 13 lines
support/scripts/gen-manual-lists.py +11 -1
+        # with a prompt, which we consider the enabling sub-option, or we end
+        # up with the providing-package's symbol.
         def _get_providers(symbol):
-            providers = list()
+            providers_syms = list()
+            providers_syms_w_opts = list()
+
+            # Get all providing packages
+            _provides_pkg = re.sub(r"^(BR2_PACKAGE)_HAS_(.+)$",
+                                   r"\1_PROVIDES_\2",
+                                   symbol.get_name())
+            _provides_sym = self.config.get_symbol(_provides_pkg)
+            for (p,_) in _provides_sym.def_exprs:

1 space after ','

support/scripts/gen-manual-lists.py class Buildroot: · line 413

Quoted 2 lines
support/scripts/gen-manual-lists.py +2 -0
+                _p = self.config._expr_val_str(p, get_val_instead_of_eval=True)
+                _p = re.sub(r"-",r"_",_p.strip('"'))

ditto

support/scripts/gen-manual-lists.py class Buildroot: · line 414

Quoted 1 line
support/scripts/gen-manual-lists.py +1 -0
+                providers_syms.append(self.config.get_symbol("BR2_PACKAGE_"+_p.upper()))

1 space before and after '+'

Quoted 5 lines
support/scripts/gen-manual-lists.py +5 -0
+
+            # Now, try to get sub-options
+            # Iterate across all symbols, to see if any selects us
+            for sym in _get_selecting_symbols_with_prompt(symbol):
+                if _symbol_is_legacy(sym):

support/scripts/gen-manual-lists.py class Buildroot: · line 429

Quoted 10 lines
support/scripts/gen-manual-lists.py +10 -0
+                    continue
+                if sym in providers_syms:
+                    # The symbol is a package that provides us, and we already
+                    # know of it
+                    continue
+                # The symbol is unknown, we suppose it is an option, so find
+                # the package it comes from
+                parent_pkg = _get_parent_package(sym)
+                if parent_pkg is not None:
+                    providers_syms_w_opts.append( (parent_pkg,sym) )

space after ','

support/scripts/gen-manual-lists.py class Buildroot: · line 434

Quoted 5 lines
support/scripts/gen-manual-lists.py +5 -0
+
+            # Now, build a list of providers with option
+            seen = list()
+            providers_str = list()
+            for (p,o) in providers_syms_w_opts:

ditto

support/scripts/gen-manual-lists.py class Buildroot: · line 437

Quoted 3 lines
support/scripts/gen-manual-lists.py +3 -0
+                if not p in seen:
+                    seen.append(p)
+                l = self._get_symbol_label(p,False) + " (w/ " \

ditto

support/scripts/gen-manual-lists.py class Buildroot: · line 438

Quoted 1 line
support/scripts/gen-manual-lists.py +1 -0
+                  + self._get_symbol_label(o,False) + ")"

ditto

support/scripts/gen-manual-lists.py class Buildroot: · line 446

Quoted 8 lines
support/scripts/gen-manual-lists.py +8 -0
+                providers_str.append(l)
+
+            # Finally, complete with the list of providers without option
+            for p in providers_syms:
+                if p in seen:
+                    continue
+                _p = re.sub(r"^BR2_PACKAGE_(.*)", r"\1", p.get_name()).lower()
+                providers_str.append(_p)

hum... here, you _p is the low-case symbol name (without the BR2_PACKAGE_ prefix), not exactly the package name (e.g. for rpi-userland, you get "rpi_userland",= instead of "rpi-userland"). Or am I missing something?

support/scripts/gen-manual-lists.py class Buildroot: · line 452

Quoted 6 lines
support/scripts/gen-manual-lists.py +6 -0
+
+            return providers_str
+
+        # This functions return a list of all symbols that have a prompt,
+        # and that 'select' the given symbol
+        def _get_selecting_symbols_with_prompt(symbol):

It's a bit weird to have the definition of this function after you use it (in the previous on), but python allows this ;-)

Quoted 35 lines
support/scripts/gen-manual-lists.py +9 -14
+            syms = list()
             for sym in self.config:
                 if not sym.is_symbol():
                     continue
-                if _symbol_is_legacy(sym):
-                    continue
                 selects = sym.get_selected_symbols()
                 if not selects:
                     continue
+                # Does this symbol selects us?
                 for s in selects:
-                    if s == symbol:
-                        if sym.prompts:
-                            l = self._get_symbol_label(sym,False)
-                            parent_pkg = _get_parent_package(sym)
-                            if parent_pkg is not None:
-                                l = self._get_symbol_label(parent_pkg, False) \
-                                  + " (w/ " + l + ")"
-                            providers.append(l)
-                        else:
-                            providers.extend(_get_providers(sym))
-            return providers
+                    if not s == symbol:
+                        continue
+                    if sym.prompts:
+                        syms.append(sym)
+                    else:
+                        syms.extend(_get_selecting_symbols_with_prompt(sym))
+            return syms
 
         if what == "layout":
             return ( "100%", "^1,4,4" )
--

1.8.3.2

Quoted 4 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Regards,

Signature · 1 line
Samuel
#9 lore raw

RFC PATCH v2 4/20 support/gen-manual-lists.py: rework generating the virtual package list

Samuel, All,

On 2014-06-15 22:18 +0200, Samuel Martin spake thusly:

Quoted 2 lines · Yann E. MORIN
Quoted 1 line

From: "Yann E. MORIN" <[email protected]>

[--SNIP a lot of typoes--]

OK, will fix all of those.

Quoted 9 lines

support/scripts/gen-manual-lists.py

Quoted 9 lines
---
 support/scripts/gen-manual-lists.py | 88 +++++++++++++++++++++++++++++++------
 1 file changed, 74 insertions(+), 14 deletions(-)
support/scripts/gen-manual-lists.py +0 -0
index 95c10dc..837cd66 100644

[--SNIP yet another bunch of typoes--]

OK, will fix.

Quoted 3 lines

support/scripts/gen-manual-lists.py class Buildroot: · line 429

Quoted 2 lines
support/scripts/gen-manual-lists.py +2 -0
+                if parent_pkg is not None:
+                    providers_syms_w_opts.append( (parent_pkg,sym) )

space after ','

I was wondering what was the coding rule when an argument is a tuple. Usually, we do not have a space after anopening brace, or before a closing brace. But it looks strange when the (only) arg is a tuple.

Should I write:
.append( (parent_pkg, sym) )
or:

    .append((parent_pkg, sym))

?

Quoted 10 lines

support/scripts/gen-manual-lists.py class Buildroot: · line 446

Quoted 6 lines
support/scripts/gen-manual-lists.py +6 -0
+            # Finally, complete with the list of providers without option
+            for p in providers_syms:
+                if p in seen:
+                    continue
+                _p = re.sub(r"^BR2_PACKAGE_(.*)", r"\1", p.get_name()).lower()
+                providers_str.append(_p)

hum... here, you _p is the low-case symbol name (without the BR2_PACKAGE_ prefix), not exactly the package name (e.g. for rpi-userland, you get "rpi_userland",= instead of "rpi-userland"). Or am I missing something?

Doh. That's right... Good catch. I'll (try to) fix that.

Quoted 8 lines

support/scripts/gen-manual-lists.py class Buildroot: · line 452

Quoted 6 lines
support/scripts/gen-manual-lists.py +6 -0
+
+            return providers_str
+
+        # This functions return a list of all symbols that have a prompt,
+        # and that 'select' the given symbol
+        def _get_selecting_symbols_with_prompt(symbol):

It's a bit weird to have the definition of this function after you use it (in the previous on), but python allows this ;-)

Well, do we want all functions to be defined before (code-wise) we call them, or do we prefer to have the important functions come first?

I usually tend to the latter. But I'll move the functions.

Thank you for the reviews! :-)

Regards,
Yann E. MORIN.

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.  |
'------------------------------^-------^------------------^--------------------'
#10 lore raw

RFC PATCH 4/20 support/gen-manual-lists.py: rework generating the virtual package list

Quoted 30 lines · Yann E. MORIN

Samuel, All,

On 2014-06-15 22:18 +0200, Samuel Martin spake thusly:

Quoted 2 lines · Yann E. MORIN
Quoted 1 line

From: "Yann E. MORIN" <[email protected]>

[--SNIP a lot of typoes--]

OK, will fix all of those.

Quoted 9 lines

support/scripts/gen-manual-lists.py

Quoted 9 lines
---
 support/scripts/gen-manual-lists.py | 88 +++++++++++++++++++++++++++++++------
 1 file changed, 74 insertions(+), 14 deletions(-)
support/scripts/gen-manual-lists.py +0 -0
index 95c10dc..837cd66 100644

[--SNIP yet another bunch of typoes--]

OK, will fix.

Quoted 3 lines

support/scripts/gen-manual-lists.py class Buildroot: · line 429

Quoted 2 lines
support/scripts/gen-manual-lists.py +2 -0
+                if parent_pkg is not None:
+                    providers_syms_w_opts.append( (parent_pkg,sym) )

space after ','

I was wondering what was the coding rule when an argument is a tuple. Usually, we do not have a space after anopening brace, or before a closing brace. But it looks strange when the (only) arg is a tuple.

Quoted 5 lines

Should I write:
.append( (parent_pkg, sym) )
or:

    .append((parent_pkg, sym))

?

Usually there is no space between the function's brackets and the tuple's ones, though I'm ok with space since it may improve readability.

Quoted 23 lines
Quoted 11 lines

support/scripts/gen-manual-lists.py class Buildroot: · line 446

Quoted 7 lines
support/scripts/gen-manual-lists.py +6 -0
+            # Finally, complete with the list of providers without option
+            for p in providers_syms:
+                if p in seen:
+                    continue
+                _p = re.sub(r"^BR2_PACKAGE_(.*)", r"\1", p.get_name()).lower()
+                providers_str.append(_p)

hum... here, you _p is the low-case symbol name (without the BR2_PACKAGE_ prefix), not exactly the package name (e.g. for rpi-userland, you get "rpi_userland",= instead of "rpi-userland"). Or am I missing something?

Doh. That's right... Good catch. I'll (try to) fix that.

Quoted 8 lines

support/scripts/gen-manual-lists.py class Buildroot: · line 452

Quoted 6 lines
support/scripts/gen-manual-lists.py +6 -0
+
+            return providers_str
+
+        # This functions return a list of all symbols that have a prompt,
+        # and that 'select' the given symbol
+        def _get_selecting_symbols_with_prompt(symbol):

It's a bit weird to have the definition of this function after you use it (in the previous on), but python allows this ;-)

Quoted 2 lines

Well, do we want all functions to be defined before (code-wise) we call them, or do we prefer to have the important functions come first?

Well, your call ;-)

Quoted 15 lines

I usually tend to the latter. But I'll move the functions.

Thank you for the reviews! :-)

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

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

'------------------------------^-------^------------------^--------------------'

Signature · 1 line
Samuel
#11 lore raw

RFC PATCH v2 5/20 package/eudev: remove the prompt

In reply to Yann E. MORIN

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

Cc Thomas Petazzoni <[email protected]>
Cc Bernd Kuhls <[email protected]>
---
 package/eudev/Config.in | 30 +++++++++---------------------
 system/Config.in        | 21 ++++++++++++++++-----
 2 files changed, 25 insertions(+), 26 deletions(-)
package/eudev/Config.in +9 -21
index 40ff721..b204a90 100644
@@ -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
index 1be7e5d..89ae46e 100644
@@ -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
#12 lore raw

RFC PATCH v2 6/20 package/systemd: remove prompt

In reply to Yann E. MORIN

From: "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, systemd 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! ;-)

Cc Thomas Petazzoni <[email protected]>
Cc Bernd Kuhls <[email protected]>
---
 package/systemd/Config.in | 53 ++++++++++++++------------------------------
 system/Config.in          | 56 ++++++++++++++++++++++++++++++++++++++---------
 2 files changed, 63 insertions(+), 46 deletions(-)
package/systemd/Config.in +17 -36
index 58f76a5..7ff36cc 100644
@@ -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
#13 lore raw

RFC PATCH v2 7/20 package/libudev: new virtual package

In reply to Yann E. MORIN

From: "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
index 88705f8..3d02d3d 100644
@@ -637,6 +637,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
new file mode 100644
index 0000000..2745fcc
@@ -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
new file mode 100644
index 0000000..af1b3dd
@@ -0,0 +1,7 @@
+################################################################################
+#
+# libudev
+#
+################################################################################
+
+$(eval $(virtual-package))
Signature · 1 line
1.8.3.2
#15 lore raw

RFC PATCH v2 8/20 package/eudev: is a provider for libudev

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

---
 package/eudev/Config.in | 4 ++++
 package/eudev/eudev.mk  | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
package/eudev/Config.in +4 -0
index b204a90..db72e95 100644
@@ -12,6 +12,7 @@ config BR2_PACKAGE_EUDEV
 	depends on BR2_LARGEFILE # util-linux
 	depends on BR2_USE_WCHAR # util-linux
 	depends on !BR2_PREFER_STATIC_LIB # kmod
+	select BR2_PACKAGE_HAS_LIBUDEV
 	select BR2_PACKAGE_HAS_UDEV
 	select BR2_PACKAGE_UTIL_LINUX
 	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
@@ -19,6 +20,9 @@ config BR2_PACKAGE_EUDEV
 
 if BR2_PACKAGE_EUDEV
 
+config BR2_PACKAGE_PROVIDES_LIBUDEV
+	default "eudev"
+
 config BR2_PACKAGE_PROVIDES_UDEV
 	default "eudev"
 
package/eudev/eudev.mk +1 -1
index 5f1525c..f837aa4 100644
@@ -25,7 +25,7 @@ EUDEV_CONF_OPT =		\
 	--enable-libkmod
 
 EUDEV_DEPENDENCIES = host-gperf host-pkgconf util-linux kmod
-EUDEV_PROVIDES = udev
+EUDEV_PROVIDES = libudev udev
 
 ifeq ($(BR2_PACKAGE_EUDEV_RULES_GEN),y)
 EUDEV_CONF_OPT += --enable-rule_generator
Signature · 1 line
1.8.3.2
#17 lore raw

RFC PATCH v2 9/20 package/systemd: is a provider for libudev

In reply to Yann E. MORIN

From: "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
index 7ff36cc..97de4dc 100644
@@ -26,6 +26,7 @@ config BR2_PACKAGE_SYSTEMD
 	depends on !BR2_PREFER_STATIC_LIB # kmod
 	depends on BR2_TOOLCHAIN_HAS_THREADS # dbus
 	depends on BR2_USE_MMU # dbus
+	select BR2_PACKAGE_HAS_LIBUDEV
 	select BR2_PACKAGE_HAS_UDEV
 	select BR2_PACKAGE_DBUS # runtime dependency only
 	select BR2_PACKAGE_LIBCAP
@@ -39,6 +40,9 @@ if BR2_PACKAGE_SYSTEMD
 
 menu "systemd"
 
+config BR2_PACKAGE_PROVIDES_LIBUDEV
+	default "systemd"
+
 config BR2_PACKAGE_PROVIDES_UDEV
 	default "systemd"
 
package/systemd/systemd.mk +1 -1
index 6de7887..b968d0b 100644
@@ -17,7 +17,7 @@ SYSTEMD_DEPENDENCIES = \
 	kmod \
 	host-gperf
 
-SYSTEMD_PROVIDES = udev
+SYSTEMD_PROVIDES = libudev udev
 SYSTEMD_AUTORECONF = YES
 
 # Make sure that systemd will always be built after busybox so that we have
Signature · 1 line
1.8.3.2
#18 lore raw

RFC PATCH v2 10/20 package/eudev: split udev/libudev

In reply to Yann E. MORIN

From: "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 also be a provider for the udev virtual package.

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.

Changes RFC -> v2:
- be a provider for libudev always, since udev is not such a provider any more (Thomas)

---
 package/Config.in       |  2 +-
 package/eudev/Config.in | 40 ++++++++++++++++++++++++++++++++++++++--
 package/eudev/eudev.mk  | 47 ++++++++++++++++++++++++++++++++++++++++++-----
 system/Config.in        |  7 ++++---
 4 files changed, 85 insertions(+), 11 deletions(-)
package/Config.in +1 -1
index 3d02d3d..9dcb37e 100644
@@ -289,7 +289,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"
@@ -637,6 +636,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
index db72e95..01f8c97 100644
@@ -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()
@@ -18,7 +39,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_LIBUDEV
 	default "eudev"
@@ -31,4 +52,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 -5

65 lines not on this page · raw message

system/Config.in +4 -3
index e711d38..856b854 100644
@@ -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
#19 lore raw

RFC PATCH v2 11/20 package/libatasmart: needs libudev, not a udev daemon

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

Do as the comment says: it's only libudev that is required.

---
 package/libatasmart/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/libatasmart/Config.in +1 -1
index 534e7c1..22d4141 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_LIBATASMART
 	bool "libatasmart"
-	depends on BR2_PACKAGE_HAS_UDEV # libudev is configure dependency
+	depends on BR2_PACKAGE_HAS_LIBUDEV
 	help
 	  The libatasmart package is a disk reporting library.
 	  It only supports a subset of the ATA S.M.A.R.T. functionality.
Signature · 1 line
1.8.3.2
#20 lore raw

RFC PATCH v2 12/20 package/libcec: needs libudev, not a udev daemon

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

libcec is happy enough with just a libudev, which it uses to enumerate CEC devices, and does not require a udev daemon.

Propagate the new dependency to XBMC.

Cc Maxime Hadjinlian <[email protected]>
Cc Bernd Kuhls <[email protected]>
---
 package/libcec/libcec.mk | 4 ++--
 package/xbmc/Config.in   | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
package/libcec/libcec.mk +2 -2
index ad919fc..49e4dbd 100644
@@ -18,8 +18,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_RPI_USERLAND),y)
package/xbmc/Config.in +3 -3
index 592fdc1..db888ac 100644
@@ -99,14 +99,14 @@ comment "libbluray support needs a toolchain w/ dynamic library"
 config BR2_PACKAGE_XBMC_LIBCEC
 	bool "hdmi cec"
 	depends on !BR2_PREFER_STATIC_LIB # libcec
-	depends on BR2_PACKAGE_HAS_UDEV
+	depends on BR2_PACKAGE_HAS_LIBUDEV # libcec
 	select BR2_PACKAGE_LIBCEC
 	help
 	  Enable CEC (Consumer Electronics Control) support.
 	  Select this if you want XBMC to support HDMI CEC.
 
-comment "hdmi cec support needs udev /dev management and a toolchain w/ dynamic library"
-	depends on BR2_PREFER_STATIC_LIB || !BR2_PACKAGE_HAS_UDEV
+comment "hdmi cec support needs a toolchain w/ dynamic library"
+	depends on BR2_PREFER_STATIC_LIB
 
 config BR2_PACKAGE_XBMC_LIBMICROHTTPD
 	bool "web server"
Signature · 1 line
1.8.3.2
#21 lore raw

RFC PATCH 12/20 package/libcec: needs libudev, not a udev daemon

Hi,

"Yann E. MORIN" <[email protected]> wrote in news:d063b08a5cb278d84fcdd031906cd9f2faf3ac8f.1402699915.git.yann.morin.1998 at free.fr:

Quoted 11 lines

From: "Yann E. MORIN" <[email protected]>

libcec is happy enough with just a libudev, which it uses to enumerate CEC devices, and does not require a udev daemon.

Propagate the new dependency to XBMC.

Cc Maxime Hadjinlian <[email protected]>
Cc Bernd Kuhls <[email protected]>

---

[...]

package/xbmc/Config.in comment "libbluray support needs a toolchain w/ dynamic library" · line 109

Quoted 4 lines
package/xbmc/Config.in +2 -2
-comment "hdmi cec support needs udev /dev management and a toolchain w/ dynamic library"
-     depends on BR2_PREFER_STATIC_LIB || !BR2_PACKAGE_HAS_UDEV
+comment "hdmi cec support needs a toolchain w/ dynamic library"
+     depends on BR2_PREFER_STATIC_LIB

I would like to keep a comment to inform users that an udev provider is needed to have cec support in xbmc.

Besides that:

Regards, Bernd

#22 lore raw

RFC PATCH v2 13/20 package/libdrm: can also use only libudev

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

Even if a udev daemon is missing, libdrm can still use just libudev to enumerate devices.

In case both udev and libudev are enabled, depending on just udev would be enough to also get libudev (since any udev provider is also a libudev provider). But it is more logical to have separate conditions for udev and libudev.

---
 package/libdrm/libdrm.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/libdrm/libdrm.mk +4 -0
index b3e4d7a..10d38e4 100644
@@ -69,4 +69,8 @@ else
 LIBDRM_CONF_OPT += --disable-udev
 endif
 
+ifeq ($(BR2_PACKAGE_HAS_LIBUDEV),y)
+LIBDRM_DEPENDENCIES += libudev
+endif
+
 $(eval $(autotools-package))
Signature · 1 line
1.8.3.2
#23 lore raw

RFC PATCH v2 14/20 package/libinput: needs libudev, not a udev daemon

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

libinput is happy enough with just a libudev, and does not require a udev daemon.

---
 package/libinput/Config.in   | 5 +----
 package/libinput/libinput.mk | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)
package/libinput/Config.in +1 -4
index 14e4e70..4445ade 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_LIBINPUT
 	bool "libinput"
-	depends on BR2_PACKAGE_HAS_UDEV
+	depends on BR2_PACKAGE_HAS_LIBUDEV
 	select BR2_PACKAGE_LIBEVDEV
 	select BR2_PACKAGE_MTDEV
 	help
@@ -12,6 +12,3 @@ config BR2_PACKAGE_LIBINPUT
 	  set of functionality that users expect.
 
 	  http://freedesktop.org/wiki/Software/libinput/
-
-comment "libinput needs udev /dev management"
-	depends on !BR2_PACKAGE_HAS_UDEV
package/libinput/libinput.mk +1 -1
index b52101a..3f225cc 100644
@@ -10,7 +10,7 @@ LIBINPUT_SITE = http://www.freedesktop.org/software/libinput
 LIBINPUT_LICENSE = MIT
 LIBINPUT_LICENSE_FILES = COPYING
 
-LIBINPUT_DEPENDENCIES = host-pkgconf libevdev mtdev udev
+LIBINPUT_DEPENDENCIES = host-pkgconf libevdev mtdev libudev
 LIBINPUT_INSTALL_STAGING = YES
 
 # Tests need fork, so just disable them everywhere.
Signature · 1 line
1.8.3.2
#24 lore raw

RFC PATCH v2 15/20 package/libusb: needs libudev, not a udev daemon

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

libusb is happy enough with just a libudev, and does not require a udev daemon.

---
 package/libusb/libusb.mk | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
package/libusb/libusb.mk +3 -2
index 417b2ce..6e1c6a5 100644
@@ -21,8 +21,9 @@ ifeq ($(BR2_avr32),y)
 LIBUSB_CONF_OPT += --disable-timerfd
 endif
 
-ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
-LIBUSB_DEPENDENCIES += udev
+ifeq ($(BR2_PACKAGE_HAS_LIBUDEV),y)
+LIBUSB_CONF_OPT += --enable-udev
+LIBUSB_DEPENDENCIES += libudev
 else
 LIBUSB_CONF_OPT += --disable-udev
 endif
Signature · 1 line
1.8.3.2
#25 lore raw

RFC PATCH v2 16/20 package/mesa3d: depends on libudev, not udev

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

---
 package/mesa3d/Config.in | 2 +-
 package/mesa3d/mesa3d.mk | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
package/mesa3d/Config.in +1 -1
index e698b3e..d912db5 100644
@@ -10,7 +10,7 @@ menuconfig BR2_PACKAGE_MESA3D
 	select BR2_PACKAGE_XLIB_LIBXDAMAGE if BR2_PACKAGE_XSERVER_XORG_SERVER
 	select BR2_PACKAGE_XLIB_LIBXFIXES if BR2_PACKAGE_XSERVER_XORG_SERVER
 	select BR2_PACKAGE_LIBXCB if BR2_PACKAGE_XSERVER_XORG_SERVER
-	depends on BR2_PACKAGE_HAS_UDEV
+	depends on BR2_PACKAGE_HAS_LIBUDEV
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_LARGEFILE
 	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
package/mesa3d/mesa3d.mk +2 -2
index 1a61af8..ca35eb9 100644
@@ -93,8 +93,8 @@ MESA3D_CONF_OPT += --enable-opengl
 
 ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL),y)
 MESA3D_PROVIDES += libegl
-# egl depends on gbm, gbm depends on udev
-MESA3D_DEPENDENCIES += udev
+# egl depends on gbm, gbm depends on libudev
+MESA3D_DEPENDENCIES += libudev
 MESA3D_EGL_PLATFORMS = drm
 ifeq ($(BR2_PACKAGE_WAYLAND),y)
 MESA3D_DEPENDENCIES += wayland
Signature · 1 line
1.8.3.2
#26 lore raw

RFC PATCH 16/20 package/mesa3d: depends on libudev, not udev

"Yann E. MORIN" <[email protected]> wrote in news:e623bd3fd72faf81d9f1bace6f97ad7c75dd39ed.1402699915.git.yann.morin.199 8 at free.fr:

Quoted 5 lines

From: "Yann E. MORIN" <[email protected]>

Signed-off-by: "Yann E. MORIN"
<[email protected]> Cc: Bernd Kuhls
<[email protected]> ---

Compile tested using this defconfig

BR2_TOOLCHAIN_EXTERNAL=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_NOUVEAU=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SVGA=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SWRAST=y
BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST=y
BR2_PACKAGE_MESA3D_DRI_DRIVER_I965=y
BR2_PACKAGE_MESA3D_DRI_DRIVER_RADEON=y
BR2_PACKAGE_MESA3D_OPENGL_EGL=y
BR2_PACKAGE_MESA3D_OPENGL_ES=y
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_EUDEV=y

Regards, Bernd

#27 lore raw

RFC PATCH v2 17/20 package/vlc: needs libudev, not a udev daemon

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

vlc is happy enough with just a libudev, and does
not require a udev daemon.

---
 package/vlc/vlc.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/vlc/vlc.mk +2 -2
index 6eb7eea..cc06818 100644
@@ -284,9 +284,9 @@ else
 VLC_CONF_OPT += --disable-tremor
 endif
 
-ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
+ifeq ($(BR2_PACKAGE_HAS_LIBUDEV),y)
 VLC_CONF_OPT += --enable-udev
-VLC_DEPENDENCIES += udev
+VLC_DEPENDENCIES += libudev
 else
 VLC_CONF_OPT += --disable-udev
 endif
Signature · 1 line
1.8.3.2
#28 lore raw

RFC PATCH v2 18/20 package/weston: needs libudev, not a udev daemon

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

weston is happy enough with just a libudev, and does not require a udev daemon.

---
 package/weston/Config.in | 6 +++---
 package/weston/weston.mk | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
package/weston/Config.in +3 -3
index aaef405..8e387ca 100644
@@ -1,6 +1,6 @@
-comment "weston needs udev and a toolchain w/ threads, headers >= 3.0"
+comment "weston needs a toolchain w/ threads, headers >= 3.0"
 	depends on !BR2_avr32
-	depends on !BR2_PACKAGE_HAS_UDEV || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
+	depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 
 config BR2_PACKAGE_WESTON
 	bool "weston"
@@ -11,7 +11,7 @@ config BR2_PACKAGE_WESTON
 	select BR2_PACKAGE_LIBPNG
 	select BR2_PACKAGE_JPEG
 	select BR2_PACKAGE_MTDEV
-	depends on BR2_PACKAGE_HAS_UDEV
+	depends on BR2_PACKAGE_HAS_LIBUDEV
 	depends on !BR2_avr32 # wayland
 	depends on BR2_TOOLCHAIN_HAS_THREADS # wayland
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
package/weston/weston.mk +1 -1
index ed0707b..c1d023a 100644
@@ -11,7 +11,7 @@ WESTON_LICENSE = MIT
 WESTON_LICENSE_FILES = COPYING
 
 WESTON_DEPENDENCIES = host-pkgconf wayland libxkbcommon pixman libpng \
-	jpeg mtdev udev cairo
+	jpeg mtdev libudev cairo
 
 WESTON_CONF_OPT = \
 	--with-dtddir=$(STAGING_DIR)/usr/share/wayland \
Signature · 1 line
1.8.3.2
#29 lore raw

RFC PATCH v2 19/20 package/xdriver_xf86-input-evdev: needs libudev, not a udev daemon

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

Do as the comment says: it's only libudev that is required.

---
 package/x11r7/xdriver_xf86-input-evdev/Config.in                   | 5 +----
 package/x11r7/xdriver_xf86-input-evdev/xdriver_xf86-input-evdev.mk | 3 ++-
 2 files changed, 3 insertions(+), 5 deletions(-)
package/x11r7/xdriver_xf86-input-evdev/Config.in +1 -4
index 6ec14bf..92f0324 100644
@@ -1,11 +1,8 @@
 config BR2_PACKAGE_XDRIVER_XF86_INPUT_EVDEV
 	bool "xf86-input-evdev"
-	depends on BR2_PACKAGE_HAS_UDEV # libudev is configure dependency
+	depends on BR2_PACKAGE_HAS_LIBUDEV
 	select BR2_PACKAGE_XPROTO_INPUTPROTO
 	select BR2_PACKAGE_XPROTO_RANDRPROTO
 	select BR2_PACKAGE_XPROTO_XPROTO
 	help
 	  Generic Linux input driver
-
-comment "xf86-input-evdev requires udev to be enabled"
-	depends on !BR2_PACKAGE_HAS_UDEV
package/x11r7/xdriver_xf86-input-evdev/xdriver_xf86-input-evdev.mk +2 -1
index 46e62c7..f2d5aad 100644
@@ -9,6 +9,7 @@ XDRIVER_XF86_INPUT_EVDEV_SOURCE = xf86-input-evdev-$(XDRIVER_XF86_INPUT_EVDEV_VE
 XDRIVER_XF86_INPUT_EVDEV_SITE = http://xorg.freedesktop.org/releases/individual/driver
 XDRIVER_XF86_INPUT_EVDEV_LICENSE = MIT
 XDRIVER_XF86_INPUT_EVDEV_LICENSE_FILES = COPYING
-XDRIVER_XF86_INPUT_EVDEV_DEPENDENCIES = xproto_inputproto xserver_xorg-server xproto_randrproto xproto_xproto udev
+XDRIVER_XF86_INPUT_EVDEV_DEPENDENCIES = xproto_inputproto xserver_xorg-server \
+					xproto_randrproto xproto_xproto libudev
 
 $(eval $(autotools-package))
Signature · 1 line
1.8.3.2
#30 lore raw

RFC PATCH v2 20/20 package/xserver_xorg-server: needs libudev, not a udev daemon

In reply to Yann E. MORIN

From: "Yann E. MORIN" <[email protected]>

xserver_xorg-server is happy enough with just a libudev, and does not require a udev daemon.

---
 package/x11r7/xserver_xorg-server/xserver_xorg-server.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/x11r7/xserver_xorg-server/xserver_xorg-server.mk +2 -2
index cae3ba0..9726921 100644
@@ -124,8 +124,8 @@ XSERVER_XORG_SERVER_DEPENDENCIES += tslib
 XSERVER_XORG_SERVER_CONF_OPT += --enable-tslib LDFLAGS="-lts"
 endif
 
-ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
-XSERVER_XORG_SERVER_DEPENDENCIES += udev
+ifeq ($(BR2_PACKAGE_HAS_LIBUDEV),y)
+XSERVER_XORG_SERVER_DEPENDENCIES += libudev
 XSERVER_XORG_SERVER_CONF_OPT += --enable-config-udev
 # udev kms support depends on libdrm
 ifeq ($(BR2_PACKAGE_LIBDRM),y)
Signature · 1 line
1.8.3.2
#31 lore raw

v2 cover Introduce libudev (branch yem/libudev)

In reply to Yann E. MORIN

Yann, Bernd,

Quoted 8 lines · Yann E. MORIN

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

To be honest, I am far from being a udev expert, but I have a question about the rationale behind a libudev-only configuration.

I thought that udev was a daemon running in the background, receiving events from the kernel through a netlink socket when devices appear/disappear, and then keeping a sort of "database" of available devices. On top of that, libudev was a client library that allows application to talk to the udev daemon to query which devices are available/not available and their characteristics. With this picture in mind, I fail to see how libudev can be useful with the udev daemon. So surely, my picture of how udev works is broken, but I'd be interested in hearing more on how libudev without the udev daemon can be useful.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#32 lore raw

v2 cover Introduce libudev (branch yem/libudev)

Thomas, All,

On 2014-06-14 10:01 +0200, Thomas Petazzoni spake thusly:

Quoted 7 lines · Yann E. MORIN
Quoted 6 lines

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.

Quoted 6 lines
Quoted 3 lines

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

To be honest, I am far from being a udev expert, but I have a question about the rationale behind a libudev-only configuration.

It is my understanding that libudev is not used to talk to a udev daemon, but is used to present a view of sysfs, instead of leaving all application reinvent their own walking of /sys, and libudev also provides monitoring of devices:

    http://www.signal11.us/oss/udev/

Now, how libudev and a udev daemon play together, I have no idea. ;-)

Regards,
Yann E. MORIN.

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.  |
'------------------------------^-------^------------------^--------------------'
#33 lore raw

v2 cover Introduce libudev (branch yem/libudev)

Dear Yann E. MORIN,

Quoted 8 lines · Yann E. MORIN
Quoted 2 lines

To be honest, I am far from being a udev expert, but I have a question about the rationale behind a libudev-only configuration.

It is my understanding that libudev is not used to talk to a udev daemon, but is used to present a view of sysfs, instead of leaving all application reinvent their own walking of /sys, and libudev also provides monitoring of devices:

    http://www.signal11.us/oss/udev/

Hum, ok, makes sense. It just uses sysfs and that's it. Thanks for the explanation!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com