Skip to content

Commit 31f13c3

Browse files
committed
Merge branch 'PR/lsblk-pttype' of https://github.com/karelzak/util-linux-work
* 'PR/lsblk-pttype' of https://github.com/karelzak/util-linux-work: lsblk: use ID_PART_ENTRY_SCHEME as fallback for PTTYPE
2 parents 7f84c9a + 23a7e08 commit 31f13c3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

misc-utils/lsblk-properties.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,12 @@ static struct lsblk_devprop *get_properties_by_udev(struct lsblk_device *ld)
103103
prop->partlabel = xstrdup(data);
104104
unhexmangle_string(prop->partlabel);
105105
}
106+
106107
if ((data = udev_device_get_property_value(dev, "ID_FS_TYPE")))
107108
prop->fstype = xstrdup(data);
108109
if ((data = udev_device_get_property_value(dev, "ID_FS_VERSION")))
109110
prop->fsversion = xstrdup(data);
111+
110112
if ((data = udev_device_get_property_value(dev, "ID_PART_ENTRY_TYPE")))
111113
prop->parttype = xstrdup(data);
112114
if ((data = udev_device_get_property_value(dev, "ID_PART_ENTRY_UUID")))
@@ -115,6 +117,9 @@ static struct lsblk_devprop *get_properties_by_udev(struct lsblk_device *ld)
115117
prop->partn = xstrdup(data);
116118
if ((data = udev_device_get_property_value(dev, "ID_PART_ENTRY_FLAGS")))
117119
prop->partflags = xstrdup(data);
120+
if (!prop->pttype &&
121+
(data = udev_device_get_property_value(dev, "ID_PART_ENTRY_SCHEME")))
122+
prop->pttype = xstrdup(data);
118123

119124
data = udev_device_get_property_value(dev, "ID_WWN_WITH_EXTENSION");
120125
if (!data)
@@ -256,6 +261,7 @@ static struct lsblk_devprop *get_properties_by_file(struct lsblk_device *ld)
256261
else if (lookup(buf, "ID_PART_ENTRY_UUID", &prop->partuuid)) ;
257262
else if (lookup(buf, "ID_PART_ENTRY_FLAGS", &prop->partflags)) ;
258263
else if (lookup(buf, "ID_PART_ENTRY_NUMBER", &prop->partn)) ;
264+
else if (lookup(buf, "ID_PART_ENTRY_SCHEME", &prop->pttype)) ;
259265
else if (lookup(buf, "ID_MODEL", &prop->model)) ;
260266
else if (lookup(buf, "ID_WWN_WITH_EXTENSION", &prop->wwn)) ;
261267
else if (lookup(buf, "ID_WWN", &prop->wwn)) ;
@@ -339,6 +345,9 @@ static struct lsblk_devprop *get_properties_by_blkid(struct lsblk_device *dev)
339345
prop->partflags = xstrdup(data);
340346
if (!blkid_probe_lookup_value(pr, "PART_ENTRY_NUMBER", &data, NULL))
341347
prop->partn = xstrdup(data);
348+
if (!prop->pttype &&
349+
!blkid_probe_lookup_value(pr, "PART_ENTRY_SCHEME", &data, NULL))
350+
prop->pttype = xstrdup(data);
342351

343352
DBG(DEV, ul_debugobj(dev, "%s: found blkid properties", dev->name));
344353
}

0 commit comments

Comments
 (0)