]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsblk: don't ask udev when --sysroot specified
authorKarel Zak <kzak@redhat.com>
Tue, 11 Sep 2018 07:53:18 +0000 (09:53 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 11 Sep 2018 07:53:18 +0000 (09:53 +0200)
We use --sysroot to get information about block devices from /proc and
/sys dumps. In this case does not make sense to read anything from
udev as udevd is about the current system devices.

Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/lsblk.c

index 396220231a765a75abb0a49ad75b9bee3de13d17..15d599cb7f82711a1491544b54372f7bf1fb3c13 100644 (file)
@@ -562,6 +562,8 @@ static int get_udev_properties(struct blkdev_cxt *cxt)
 
        if (cxt->probed)
                return 0;               /* already done */
+       if (lsblk->sysroot)
+               return -1;              /* don't ask udev when read from data from dump */
 
        if (!udev)
                udev = udev_new();