mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05:21 +01:00
Linux only: allow NVMe destination drives
ON LINUX PLATFORM ONLY Allow NVMe destination drives as long as they are not mounted except under /media This does increase the risk of someone accidently selecting an internal NVMe drive that is not mounted under the current OS (Linux) but do is being used by the other operating system (e.g. Windows) on dual boot systems. But is deemed to be an acceptable risk. Ref #158
This commit is contained in:
parent
2700f61eb9
commit
906ceabaec
2 changed files with 25 additions and 1 deletions
|
@ -126,6 +126,25 @@ namespace Drivelist
|
|||
}
|
||||
dp.removeAll("");
|
||||
d.description = dp.join(" ").toStdString();
|
||||
|
||||
/* Mark internal NVMe drives as non-system if not mounted
|
||||
anywhere else than under /media */
|
||||
if (d.isSystem && subsystems.contains("nvme"))
|
||||
{
|
||||
bool isMounted = false;
|
||||
for (std::string mp : d.mountpoints)
|
||||
{
|
||||
if (!QByteArray::fromStdString(mp).startsWith("/media/")) {
|
||||
isMounted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isMounted)
|
||||
{
|
||||
d.isSystem = false;
|
||||
}
|
||||
}
|
||||
|
||||
deviceList.push_back(d);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue