]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsblk: read ID_SCSI_IDENT_SERIAL if available
authorKarel Zak <kzak@redhat.com>
Wed, 23 Sep 2020 13:41:05 +0000 (15:41 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 13 Nov 2020 11:03:24 +0000 (12:03 +0100)
This SERIAL comes from sg3_utils.

Addresses: https://github.com/karelzak/util-linux/issues/1143
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/lsblk-properties.c

index 9e79be35339c9ebd2765422a584fb47122420783..b8aa681845358004d22802cf373c1f651917ef56 100644 (file)
@@ -209,6 +209,7 @@ static struct lsblk_devprop *get_properties_by_file(struct lsblk_device *ld)
                else if (lookup(buf, "ID_MODEL", &prop->model)) ;
                else if (lookup(buf, "ID_WWN_WITH_EXTENSION", &prop->wwn)) ;
                else if (lookup(buf, "ID_WWN", &prop->wwn)) ;
+               else if (lookup(buf, "ID_SCSI_IDENT_SERIAL", &prop->serial)) ;  /* serial from sg3_utils */
                else if (lookup(buf, "ID_SCSI_SERIAL", &prop->serial)) ;
                else if (lookup(buf, "ID_SERIAL_SHORT", &prop->serial)) ;
                else if (lookup(buf, "ID_SERIAL", &prop->serial)) ;