]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lsblk: add dependence between CD/DVD block and packet devices
authorKarel Zak <kzak@redhat.com>
Mon, 23 Nov 2020 14:16:39 +0000 (15:16 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 24 Nov 2020 09:44:46 +0000 (10:44 +0100)
commit94ebe1d3e46e454d99fd157286b0a78dc1523c6a
treec28922ef0a4f014dc9fc764157b102da3037913e
parent1e416dc0b9933961e75ac67fa3aed7598273443f
lsblk: add dependence between CD/DVD block and packet devices

This dependence is defined by

  $ cat /sys/class/pktcdvd/device_map
  pktcdvd0 252:0 11:0

Unfortunately, there is not any direct sysfs way how to refer this
relationship in /sys/{block,dev/block}. So, we have to read the
device_map file and then compare device numbers with the list.

$ lsblk /dev/sr0
NAME       MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0         11:0    1 1024M  0 rom
└─pktcdvd0 252:0    1    0B  0 disk

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