summaryrefslogtreecommitdiffstats
path: root/misc-utils
diff options
context:
space:
mode:
authorSven Wiltink2019-02-08 10:53:21 +0100
committerKarel Zak2019-02-11 10:37:27 +0100
commitc2f6513c106f5522555a8c129f4e6579b9642c65 (patch)
tree390d3c5058717831c9ad5adf2b3cf5a4f535ab3b /misc-utils
parenthardlink: cleanup error messages, use xalloc.h (diff)
downloadkernel-qcow2-util-linux-c2f6513c106f5522555a8c129f4e6579b9642c65.tar.gz
kernel-qcow2-util-linux-c2f6513c106f5522555a8c129f4e6579b9642c65.tar.xz
kernel-qcow2-util-linux-c2f6513c106f5522555a8c129f4e6579b9642c65.zip
lsblk: use ID_SCSI_SERIAL when available
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils')
-rw-r--r--misc-utils/lsblk-properties.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/misc-utils/lsblk-properties.c b/misc-utils/lsblk-properties.c
index 30168dd48..530332fec 100644
--- a/misc-utils/lsblk-properties.c
+++ b/misc-utils/lsblk-properties.c
@@ -96,8 +96,12 @@ static struct lsblk_devprop *get_properties_by_udev(struct lsblk_device *ld)
if (data)
prop->wwn = xstrdup(data);
- if ((data = udev_device_get_property_value(dev, "ID_SERIAL_SHORT")))
+ data = udev_device_get_property_value(dev, "ID_SCSI_SERIAL");
+ if(!data)
+ data = udev_device_get_property_value(dev, "ID_SERIAL_SHORT");
+ if (data)
prop->serial = xstrdup(data);
+
if ((data = udev_device_get_property_value(dev, "ID_MODEL")))
prop->model = xstrdup(data);