]> git.ozlabs.org Git - petitboot/commitdiff
discover/devmapper: Read device size from sysfs
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Thu, 7 Apr 2016 05:29:02 +0000 (15:29 +1000)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Fri, 8 Apr 2016 04:16:00 +0000 (14:16 +1000)
If udev doesn't export the ID_PART_ENTRY_SIZE variable for a device we
skip creating a snapshot for it. However in most cases the sysfs
attribute which udev reads to find ID_PART_ENTRY_SIZE is still
available. Therefore if we don't have access to ID_PART_ENTRY_SIZE try
to find the size in sysfs directly.
This allows us to create snapshots for devices which often don't have
this udev variable set, such as software raid (md) devices and NVMe
devices.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>

No differences found