Skip to contentSkip to conversation

package/util-linux: select BR2_PACKAGE_UTIL_LINUX_LIBS

PATCH Superseded Fabrice Fontaine 2 participants 4 messages Nov 1, 2020 – Nov 3, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/util-linux: select BR2_PACKAGE_UTIL_LINUX_LIBS

When util-linux is enabled, select BR2_PACKAGE_UTIL_LINUX_LIBS as
suggested by Yann E. Morin in
https://patchwork.ozlabs.org/project/buildroot/patch/20201101121536.1089498-1-fontaine.fabrice at gmail.com/

As a result, drop BR2_PACKAGE_UTIL_LINUX_LIBS workaround from libglib2 and drop select of BR2_PACKAGE_UTIL_LINUX_LIBS from eudev and systemd

---
 package/eudev/Config.in      | 1 -
 package/libglib2/libglib2.mk | 4 ----
 package/systemd/Config.in    | 1 -
 package/util-linux/Config.in | 1 +
 4 files changed, 1 insertion(+), 6 deletions(-)
package/eudev/Config.in +0 -1
index 0e5bd0cee9..b0ce76171a 100644
@@ -7,7 +7,6 @@ config BR2_PACKAGE_EUDEV
 	select BR2_PACKAGE_HAS_UDEV
 	select BR2_PACKAGE_UDEV_GENTOO_SCRIPTS if BR2_INIT_OPENRC
 	select BR2_PACKAGE_UTIL_LINUX
-	select BR2_PACKAGE_UTIL_LINUX_LIBS
 	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
 	select BR2_PACKAGE_KMOD
 	help
package/libglib2/libglib2.mk +0 -4
index 6e9dbd7b26..43fcb27fae 100644
@@ -86,12 +86,8 @@ endif
 
 ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBMOUNT),y)
 LIBGLIB2_CONF_OPTS += -Dlibmount=enabled
-ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBS),y)
 LIBGLIB2_DEPENDENCIES += util-linux-libs
 else
-LIBGLIB2_DEPENDENCIES += util-linux
-endif
-else
 LIBGLIB2_CONF_OPTS += -Dlibmount=disabled
 endif
 
package/systemd/Config.in +0 -1
index ec34478e3d..9188876d49 100644
@@ -29,7 +29,6 @@ menuconfig BR2_PACKAGE_SYSTEMD
 	select BR2_PACKAGE_DBUS # runtime dependency only
 	select BR2_PACKAGE_LIBCAP
 	select BR2_PACKAGE_UTIL_LINUX
-	select BR2_PACKAGE_UTIL_LINUX_LIBS
 	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
 	select BR2_PACKAGE_UTIL_LINUX_AGETTY
 	select BR2_PACKAGE_UTIL_LINUX_MOUNT
package/util-linux/Config.in +1 -0
index 1f33eb5514..cee4649f67 100644
@@ -1,5 +1,6 @@
 menuconfig BR2_PACKAGE_UTIL_LINUX
 	bool "util-linux"
+	select BR2_PACKAGE_UTIL_LINUX_LIBS
 	help
 	  Various useful/essential linux libraries and utilities.
 
Signature · 1 line
2.28.0
#1 lore raw

PATCH 2/2 package/abootimg: use util-linux-libs

abootimg only needs libblkid from util-linux-libs

---
 package/abootimg/abootimg.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/abootimg/abootimg.mk +2 -2
index e906546948..d139d58ceb 100644
@@ -9,8 +9,8 @@ ABOOTIMG_SITE = $(call github,ggrandou,abootimg,$(ABOOTIMG_VERSION))
 ABOOTIMG_LICENSE = GPL-2.0+
 ABOOTIMG_LICENSE_FILES = LICENSE
 
-# depends on libblkid from util-linux
-ABOOTIMG_DEPENDENCIES = util-linux
+# depends on libblkid from util-linux-libs
+ABOOTIMG_DEPENDENCIES = util-linux-libs
 
 define ABOOTIMG_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
Signature · 1 line
2.28.0
#2 lore raw

PATCH 1/2 package/util-linux: select BR2_PACKAGE_UTIL_LINUX_LIBS

In reply to Fabrice Fontaine

Fabrice, All,

+Thomas, +Peter, +Arnout, further reading and input from you required below...

On 2020-11-01 16:06 +0100, Fabrice Fontaine spake thusly:

Quoted 3 lines

When util-linux is enabled, select BR2_PACKAGE_UTIL_LINUX_LIBS as
suggested by Yann E. Morin in
https://patchwork.ozlabs.org/project/buildroot/patch/20201101121536.1089498-1-fontaine.fabrice at gmail.com/

I think there is quite some misunderstanding in what I said; sorry, I was probably not completely clear in what I said...

Quoted 2 lines

As a result, drop BR2_PACKAGE_UTIL_LINUX_LIBS workaround from libglib2 and drop select of BR2_PACKAGE_UTIL_LINUX_LIBS from eudev and systemd

Quite the opposite; it is what all packages should do.

The rule should be:

- need util-linux tools?

    -> select BR2_PACKAGE_UTIL_LINUX (and the subset of required tools,
       if needed)

- need util-linux' libraries?

    -> select BR2_PACKAGE_UTIL_LINUX_LIBS and the needed libraries

So, to complement my previous reply:

- the BR2_PACKAGE_UTIL_LINUX_LIBMOUNT (for example) should berndn option of util-linux-libs, so that the library is built by util-linux

- those options are what packages should select

However, there is acatch, which we need to be careful about:

- if both util-linux and util-linux-libs install libraries, then that would cause grief because that break the rule that no two packages should install the same file in target/

- AFAICS, there is no (trivial) way to tell util-linux to only install libs or programs, not both.

One way around that would be to:

- ensure that both util-linux and util-linux-libs really build the exact same libraries

- if util-linux is enabled, install it in target only, and install util-linux-libs only in staging

- if util-linux is not enabled, install util-linux-libs in both staging and target

Yes, this is kinda a hack, so we'd need further input before actually comitting to this...

Regards,
Yann E. MORIN.

Quoted 63 lines
---
 package/eudev/Config.in      | 1 -
 package/libglib2/libglib2.mk | 4 ----
 package/systemd/Config.in    | 1 -
 package/util-linux/Config.in | 1 +
 4 files changed, 1 insertion(+), 6 deletions(-)
package/eudev/Config.in +0 -1
index 0e5bd0cee9..b0ce76171a 100644
@@ -7,7 +7,6 @@ config BR2_PACKAGE_EUDEV
 	select BR2_PACKAGE_HAS_UDEV
 	select BR2_PACKAGE_UDEV_GENTOO_SCRIPTS if BR2_INIT_OPENRC
 	select BR2_PACKAGE_UTIL_LINUX
-	select BR2_PACKAGE_UTIL_LINUX_LIBS
 	select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
 	select BR2_PACKAGE_KMOD
 	help
package/libglib2/libglib2.mk +0 -4
index 6e9dbd7b26..43fcb27fae 100644
@@ -86,12 +86,8 @@ endif
 
 ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBMOUNT),y)
 LIBGLIB2_CONF_OPTS += -Dlibmount=enabled
-ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBS),y)
 LIBGLIB2_DEPENDENCIES += util-linux-libs
 else
-LIBGLIB2_DEPENDENCIES += util-linux
-endif
-else
 LIBGLIB2_CONF_OPTS += -Dlibmount=disabled
 endif
 
package/systemd/Config.in +0 -1
index ec34478e3d..9188876d49 100644
@@ -29,7 +29,6 @@ menuconfig BR2_PACKAGE_SYSTEMD
 	select BR2_PACKAGE_DBUS # runtime dependency only
 	select BR2_PACKAGE_LIBCAP
 	select BR2_PACKAGE_UTIL_LINUX
-	select BR2_PACKAGE_UTIL_LINUX_LIBS
 	select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
 	select BR2_PACKAGE_UTIL_LINUX_AGETTY
 	select BR2_PACKAGE_UTIL_LINUX_MOUNT
package/util-linux/Config.in +1 -0
index 1f33eb5514..cee4649f67 100644
@@ -1,5 +1,6 @@
 menuconfig BR2_PACKAGE_UTIL_LINUX
 	bool "util-linux"
+	select BR2_PACKAGE_UTIL_LINUX_LIBS
 	help
 	  Various useful/essential linux libraries and utilities.
 
Signature · 1 line
2.28.0
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/2 package/util-linux: select BR2_PACKAGE_UTIL_LINUX_LIBS

Le mar. 3 nov. 2020 ? 21:58, Yann E. MORIN <[email protected]> a ?crit :

Quoted 19 lines

Fabrice, All,

+Thomas, +Peter, +Arnout, further reading and input from you required below...

On 2020-11-01 16:06 +0100, Fabrice Fontaine spake thusly:

Quoted 3 lines

When util-linux is enabled, select BR2_PACKAGE_UTIL_LINUX_LIBS as
suggested by Yann E. Morin in
https://patchwork.ozlabs.org/project/buildroot/patch/20201101121536.1089498-1-fontaine.fabrice at gmail.com/

I think there is quite some misunderstanding in what I said; sorry, I was probably not completely clear in what I said...

Quoted 2 lines

As a result, drop BR2_PACKAGE_UTIL_LINUX_LIBS workaround from libglib2 and drop select of BR2_PACKAGE_UTIL_LINUX_LIBS from eudev and systemd

Quite the opposite; it is what all packages should do.

Quoted 9 lines

The rule should be:

- need util-linux tools?

    -> select BR2_PACKAGE_UTIL_LINUX (and the subset of required tools,
       if needed)

- need util-linux' libraries?

    -> select BR2_PACKAGE_UTIL_LINUX_LIBS and the needed libraries

I sent a v2 with these changes thanks to your reply on the other thread.

Quoted 21 lines

So, to complement my previous reply:

- the BR2_PACKAGE_UTIL_LINUX_LIBMOUNT (for example) should berndn option of util-linux-libs, so that the library is built by util-linux

- those options are what packages should select

However, there is acatch, which we need to be careful about:

- if both util-linux and util-linux-libs install libraries, then that would cause grief because that break the rule that no two packages should install the same file in target/

- AFAICS, there is no (trivial) way to tell util-linux to only install libs or programs, not both.

One way around that would be to:

- ensure that both util-linux and util-linux-libs really build the exact same libraries

Quoted 8 lines

- if util-linux is enabled, install it in target only, and install util-linux-libs only in staging

- if util-linux is not enabled, install util-linux-libs in both staging and target

Yes, this is kinda a hack, so we'd need further input before actually comitting to this...

I'll wait for your feedback concerning this part however it should be noted that we already have build failures due to util-linux circular dependencies.
I fixed libglib2 by adding this ugly util-linux or util-linux-libs dependency "hack" but I also spotted the same issue in the autobuilders for fontconfig and cryptsetup:

fontconfig -> util-linux -> udev -> systemd -> polkit -> gobject-introspection -> cairo -> fontconfig cryptsetup -> util-linux -> udev -> systemd -> cryptsetup

Quoted 70 lines

Regards,
Yann E. MORIN.

Quoted 61 lines
---
 package/eudev/Config.in      | 1 -
 package/libglib2/libglib2.mk | 4 ----
 package/systemd/Config.in    | 1 -
 package/util-linux/Config.in | 1 +
 4 files changed, 1 insertion(+), 6 deletions(-)
package/eudev/Config.in +0 -1
index 0e5bd0cee9..b0ce76171a 100644
@@ -7,7 +7,6 @@ config BR2_PACKAGE_EUDEV
      select BR2_PACKAGE_HAS_UDEV
      select BR2_PACKAGE_UDEV_GENTOO_SCRIPTS if BR2_INIT_OPENRC
      select BR2_PACKAGE_UTIL_LINUX
-     select BR2_PACKAGE_UTIL_LINUX_LIBS
      select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
      select BR2_PACKAGE_KMOD
      help
package/libglib2/libglib2.mk +0 -4
index 6e9dbd7b26..43fcb27fae 100644
@@ -86,12 +86,8 @@ endif
 
 ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBMOUNT),y)
 LIBGLIB2_CONF_OPTS += -Dlibmount=enabled
-ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBS),y)
 LIBGLIB2_DEPENDENCIES += util-linux-libs
 else
-LIBGLIB2_DEPENDENCIES += util-linux
-endif
-else
 LIBGLIB2_CONF_OPTS += -Dlibmount=disabled
 endif
 
package/systemd/Config.in +0 -1
index ec34478e3d..9188876d49 100644
@@ -29,7 +29,6 @@ menuconfig BR2_PACKAGE_SYSTEMD
      select BR2_PACKAGE_DBUS # runtime dependency only
      select BR2_PACKAGE_LIBCAP
      select BR2_PACKAGE_UTIL_LINUX
-     select BR2_PACKAGE_UTIL_LINUX_LIBS
      select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
      select BR2_PACKAGE_UTIL_LINUX_AGETTY
      select BR2_PACKAGE_UTIL_LINUX_MOUNT
package/util-linux/Config.in +1 -1
index 1f33eb5514..cee4649f67 100644
@@ -1,5 +1,6 @@
 menuconfig BR2_PACKAGE_UTIL_LINUX
      bool "util-linux"
+     select BR2_PACKAGE_UTIL_LINUX_LIBS
      help
        Various useful/essential linux libraries and utilities.
 
--
Quoted 2 lines

2.28.0

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

Quoted 5 lines
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

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

Best Regards,

Fabrice