Skip to contentSkip to conversation

New: lsblk (util-linux) should depend on libudev if available

Buildroot bugzilla at busybox.net 1 participant 14 messages Apr 30, 2019 – Nov 4, 2020

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=11811

Bug ID: 11811
Summary: lsblk (util-linux) should depend on libudev if
available
Product: buildroot
Version: 2019.02.2
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: Other
Assignee: unassigned at buildroot.uclibc.org
Reporter: pmorici at dev295.com
CC: buildroot at uclibc.org
Target Milestone: ---

Several of the output columns of lsblk such as SERIAL and WWN are incorrectly reported as empty strings. ie: 'lsblk -do SERIAL'

The cause is that lsblk uses libudev to obtain this information but the util-linux package doesn't list the udev package as a dependency if it is selected. If util-linux gets built before udev then many parts of lsblk return empty strings for various fields.

Adding the following to packages/util-linux/util-linux.mk fixes the problem.

ifeq ($(BR2_PACKAGE_UDEV),y)
UTIL_LINUX_DEPENDENCIES += udev
endif

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#1 lore raw

[Buildroot] [Bug 11811] lsblk (util-linux) should depend on libudev if available

https://bugs.busybox.net/show_bug.cgi?id=11811

--- Comment #1 from Thomas Petazzoni <[email protected]> --- I don't think the fix can be that simple: it causes a circular dependency.

Indeed "udev" is provided either by the "eudev" or "systemd" packages. And both eudev and systemd depend on util-linux:

EUDEV_DEPENDENCIES = host-gperf host-pkgconf util-linux kmod

SYSTEMD_DEPENDENCIES = \
        $(if $(BR2_PACKAGE_BASH_COMPLETION),bash-completion) \
        host-gperf \
        host-intltool \
        kmod \
        libcap \
        util-linux

So, by adding a dependency on udev in util-linux, you create a circular dependency.

I'm not sure how we can break this circular dependency, unfortunately :-/

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#2 lore raw

[Buildroot] [Bug 11811] lsblk (util-linux) should depend on libudev if available

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11811

--- Comment #2 from Pete Morici <[email protected]> ---
Yeah, I spoke too soon. Doing a dirclean on util-linux and rebuilding after a full build corrects the issue but that isn't a solution.

Could libudev be broken out into a separate package that can be built before the whole? I'm not familiar enough with buildroot yet to know what a good way to approach this is.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#3 lore raw

[Buildroot] [Bug 11811] lsblk (util-linux) should depend on libudev if available

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11811

--- Comment #3 from Pete Morici <[email protected]> ---
Do systemd and eudev only need libblkid from util-linux? Can that be broken out into a separate package that they depend on? It looks like you can select to only build libblkid using the configure line, "./configure --disable-all-programs --enable-libblkid" for util-linux

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#4 lore raw

[Buildroot] [Bug 11811] lsblk (util-linux) should depend on libudev if available

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11811

Carlos Santos <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |ASSIGNED
           Assignee|unassigned at buildroot.uclibc |unixmania at gmail.com
                   |.org                        |

--- Comment #4 from Carlos Santos <[email protected]> --- I'm taking this bug.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#5 lore raw

[Buildroot] [Bug 11811] lsblk (util-linux) should depend on libudev if available

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11811

--- Comment #5 from Carlos Santos <[email protected]> --- (In reply to Pete Morici from comment #3)

It would be possible to have a util-linux-libs package providing libblkid and a util-linux package with the utilities, only. Another solution would be doing the same as Fedora, on which libeudev is provided by a systemd-libs package on which util-linux depends.

I will investigate both solutions and post the results as soon as possible.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#6 lore raw

[Buildroot] [Bug 11811] lsblk (util-linux) should depend on libudev if available

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11811

--- Comment #6 from Carlos Santos <[email protected]> ---
I investigated the problem and was unable to reproduce the problem on my test hardware:

# lsblk -do NAME,SERIAL
NAME         SERIAL
sda          
mmcblk0      0x439da3eb
mmcblk0boot0 
mmcblk0boot1 

Could you please post a defconfig, preferably based on one of the already existing qemu defconfig's, with which the problem happens?

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#8 lore raw

[Buildroot] [Bug 11811] lsblk (util-linux) should depend on libudev if available

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11811

Pete Morici <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

   Attachment #8021|application/octet-stream    |text/plain
          mime type|                            |
Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#9 lore raw

[Buildroot] [Bug 11811] lsblk (util-linux) should depend on libudev if available

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11811

--- Comment #8 from Pete Morici <[email protected]> ---
I've attached my config it is a modified version of the included pc/efi def config.

Looking at your output though I think you have reproduced the problem. The serial column for your sda device is blank. You can also get the serial by running the utility "/lib/udev/ata_id /dev/sda" If that returns something where lsblk returns a blank then that is the problem. I've not tested this with MMC or SD devices so it might be limited to SATA and USB drives.

Another way to see the difference is to do a full build followed by a "make util-linux-dirclean" and then "make" again that will cause lsblk to link against libudev and report the serial number correctly.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#10 lore raw

[Buildroot] [Bug 11811] lsblk (util-linux) should depend on libudev if available

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11811

--- Comment #9 from Carlos Santos <[email protected]> --- I just sent for review a patch that fixes the problem:

    https://patchwork.ozlabs.org/patch/1096436/

The solution requires a quite invasive patch to avoid building and installing the util-linux libraries twice.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#12 lore raw

[Buildroot] [Bug 11811] lsblk (util-linux) should depend on libudev if available

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11811

Carlos Santos <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
Assignee|unixmania at gmail.com |unassigned at buildroot.uclibc
| |.org

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#13 lore raw

[Buildroot] [Bug 11811] lsblk (util-linux) should depend on libudev if available

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=11811

Peter Korsgaard <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #11 from Peter Korsgaard <[email protected]> --- This has now finally been merged in
https://git.buildroot.org/buildroot/commit/?id=8bafc6dc8ad13000a58af980650ff59a78399ae2,
thanks

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.