]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsblk: read SCSI_IDENT_SERIAL also from udev
authorKarel Zak <kzak@redhat.com>
Mon, 14 Dec 2020 10:38:04 +0000 (11:38 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 10 Feb 2021 08:54:15 +0000 (09:54 +0100)
Addresses: https://github.com/karelzak/util-linux/issues/1143
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/lsblk-properties.c

index 19401715f864a6d71aa8788f887d9d36dc718340..6429db06e1183811bbeabaebaec39c7ae6a742f5 100644 (file)
@@ -104,7 +104,9 @@ static struct lsblk_devprop *get_properties_by_udev(struct lsblk_device *ld)
                if (data)
                        prop->wwn = xstrdup(data);
 
-               data = udev_device_get_property_value(dev, "ID_SCSI_SERIAL");
+               data = udev_device_get_property_value(dev, "SCSI_IDENT_SERIAL");        /* sg3_utils do not use I_D prefix */
+               if (!data)
+                       data = udev_device_get_property_value(dev, "ID_SCSI_SERIAL");
                if(!data)
                        data = udev_device_get_property_value(dev, "ID_SERIAL_SHORT");
                if(!data)