From 52af71cff976aaa96f26ce389be1a7f76a10b86c Mon Sep 17 00:00:00 2001 From: Eddy-Wallace Date: Fri, 11 Aug 2023 11:53:23 +0200 Subject: [PATCH] Hotfix for Issue #610 Possible hotfix for newer version of lsblk on Arch based distributions. --- src/linux/linuxdrivelist.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/linux/linuxdrivelist.cpp b/src/linux/linuxdrivelist.cpp index d49b9b6..e016231 100644 --- a/src/linux/linuxdrivelist.cpp +++ b/src/linux/linuxdrivelist.cpp @@ -74,6 +74,14 @@ namespace Drivelist d.device = name.toStdString(); d.raw = true; 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()) { /* With some lsblk versions it is a bool in others a "0" or "1" string */