Hotfix for Issue #610

Possible hotfix for newer version of lsblk on Arch based distributions.
This commit is contained in:
Eddy-Wallace 2023-08-11 11:53:23 +02:00
parent b49408781a
commit 52af71cff9
No known key found for this signature in database
GPG key ID: 2B5AA7B4DE93E676

View file

@ -74,6 +74,14 @@ namespace Drivelist
d.device = name.toStdString(); d.device = name.toStdString();
d.raw = true; d.raw = true;
d.isVirtual = subsystems == "block"; d.isVirtual = subsystems == "block";
// Hot fix for newer lsblk version on Arch based linux distributions.
// See issue #610
// Only tested with laptop's internal sd card reader.
if (!d.isVirtual && subsystems.contains("mmc")) {
d.isVirtual = subsystems.contains("block"); //< lsblk will output something like "block:mmc:mmc_host:pci" for key "subsystems".
}
if (bdev["ro"].isBool()) if (bdev["ro"].isBool())
{ {
/* With some lsblk versions it is a bool in others a "0" or "1" string */ /* With some lsblk versions it is a bool in others a "0" or "1" string */