From: Karel Zak Date: Wed, 23 Sep 2020 13:41:05 +0000 (+0200) Subject: lsblk: read ID_SCSI_IDENT_SERIAL if available X-Git-Tag: v2.36.1~49 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=392c4d91313e2fb24daeffdb354999b00864d2bb;p=thirdparty%2Futil-linux.git lsblk: read ID_SCSI_IDENT_SERIAL if available This SERIAL comes from sg3_utils. Addresses: https://github.com/karelzak/util-linux/issues/1143 Signed-off-by: Karel Zak --- diff --git a/misc-utils/lsblk-properties.c b/misc-utils/lsblk-properties.c index 9e79be3533..b8aa681845 100644 --- a/misc-utils/lsblk-properties.c +++ b/misc-utils/lsblk-properties.c @@ -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)) ;