lsblk: don't ask udev when --sysroot specified

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>
This commit is contained in:
Karel Zak 2018-09-11 09:53:18 +02:00
parent f1a7cfcb1d
commit 137599ebe1
1 changed files with 2 additions and 0 deletions

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