Skip to content

Commit

Permalink
Linux only: allow NVMe destination drives
Browse files Browse the repository at this point in the history
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
  • Loading branch information
maxnet committed Feb 26, 2021
1 parent 2700f61 commit 906ceab
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
7 changes: 6 additions & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ rpi-imager (1.6) unstable; urgency=medium

* Wayland: fix "Client tried to set invalid geometry" error
* Add advanced users option screen available under SHIFT-CTRL-X
* Disable high DPI scaling on incorrect EDID
* Fix handling of .iso files
* Update translations
* GUI: change "SD card" -> "Storage"
* Allow NVMe drives as destination drive (Linux only)

-- Floris Bos <[email protected]> Fri, 15 Jan 2021 22:00:21 +0100
-- Floris Bos <[email protected]> Fri, 26 Feb 2021 14:32:21 +0100

rpi-imager (1.5) unstable; urgency=medium

Expand Down
19 changes: 19 additions & 0 deletions linux/linuxdrivelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 906ceab

Please sign in to comment.