Merge pull request #618 from Eddy-Wallace/feat/lsblk-arch-hotfix

Hotfix for Issue #610
This commit is contained in:
maxnet 2023-09-22 20:38:05 +02:00 committed by GitHub
commit 4c71a2294e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 */