Commit Graph

13 Commits

Author SHA1 Message Date
Karel Zak 1492fb4ef2 lsblk: read SCSI_IDENT_SERIAL also from udev
Addresses: https://github.com/karelzak/util-linux/issues/1143
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-12-14 11:38:04 +01:00
Karel Zak b95752ad20 lsblk: fix SCSI_IDENT_SERIAL
It seems sg3_utils does not use ID_ prefix like other udev stuff.

Addresses: https://github.com/karelzak/util-linux/issues/1143
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-24 09:56:03 +02:00
Karel Zak de6c2a4aec 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 <kzak@redhat.com>
2020-09-23 15:41:05 +02:00
Sven Wiltink e81d0f8006 lsblk: Fall back to ID_SERIAL
In some cases ID_SERIAL_SHORT isn't provided by libudev, but ID_SERIAL
is. An example of this are virtio devices. See the output of udevadm
info:
P: /devices/pci0000:00/0000:00:06.0/virtio2/block/vdb
N: vdb
S: disk/by-id/virtio-08491434ee711d3420e9
S: disk/by-path/pci-0000:00:06.0
S: disk/by-path/virtio-pci-0000:00:06.0
E: DEVLINKS=/dev/disk/by-id/virtio-08491434ee711d3420e9 /dev/disk/by-path/pci-0000:00:06.0 /dev/disk/by-path/virtio-pci-0000:00:06.0
E: DEVNAME=/dev/vdb
E: DEVPATH=/devices/pci0000:00/0000:00:06.0/virtio2/block/vdb
E: DEVTYPE=disk
E: ID_PATH=pci-0000:00:06.0
E: ID_PATH_TAG=pci-0000_00_06_0
E: ID_SERIAL=08491434ee711d3420e9
E: MAJOR=252
E: MINOR=16
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: USEC_INITIALIZED=1403804

[kzak@redhat.com: - add ID_SERIAL also to get_properties_by_file()]

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-04 11:21:01 +02:00
Rosen Penev ad296391f9
[clang-tidy] fix wrong *cmp usage
Found with bugprone-suspicious-string-compare

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-20 13:21:00 -07:00
Karel Zak 107e955946 lsblk: add PARTTYPENAME column
Print also partition type in human-readable way.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1777261
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-04 12:38:57 +01:00
Karel Zak 9cca1ef2d5 lsblk: add FSVER (filesystem version) column
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1764523
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-12 13:55:55 +01:00
Karel Zak eea06b92dc lsblk: never fallback to udev/blkid on --sysroot
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-29 13:12:18 +01:00
Karel Zak 6f74ede50a lsblk: read also GROUP,OWNER and MODE from dumps
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-15 13:08:09 +02:00
Karel Zak 7408a5d9c2 lsblk: on --sysroot read attributes from /dev/<devname> text file
The option --sysroot is used to read information from dumps rather
than from the current system. This patch allows to read also udev
attributes from text file in location /sysroot/dev/<devname>. The file
is text file in format NAME=value\n.

Suggested-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-10-15 12:36:16 +02:00
Sven Wiltink c2f6513c10 lsblk: use ID_SCSI_SERIAL when available
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-02-11 10:37:27 +01:00
Karel Zak fed34a1e63 lsblk: rename blkdev_cxt to lsblk_device
The patch does not change code logic and semantic -- just rename.

* set_cxt() to set_device()
* struct blkdev_cxt to lsblk_device

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-12-07 12:32:57 +01:00
Karel Zak ccafadb7c5 lsblk: move udev and blkid stuff to lsblk-properties.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-19 11:40:17 +02:00