Fix timeout on systems with large numbers of loops

On systems with a very large number of snap packages installed, there
are a considerable number of loop devices. In this case, the `lsblk`
command in linuxdrivelist fills the stdout pipe, blocks, and the
rpi-imager process assumes it has timed out [1].

This is a trivial work-around that simply excludes loop devices
(major=7) from the `lsblk` output. Given subsequent code excludes
everything starting with `/dev/loop` anyway, there should be no change
in user experience with this exclusion.

[1]: https://github.com/waveform80/imager-snap/issues/6
This commit is contained in:
Dave Jones 2024-05-21 16:01:17 +01:00 committed by Tom Dewey
parent f79a6874d8
commit b00815058f

View file

@ -48,7 +48,7 @@ namespace Drivelist
std::vector<DeviceDescriptor> deviceList;
QProcess p;
QStringList args = { "--bytes", "--json", "--paths", "--output-all" };
QStringList args = { "--bytes", "--json", "--paths", "--output-all", "--exclude", "7" };
p.start("lsblk", args);
p.waitForFinished(2000);
QByteArray output = p.readAll();