Skip to content

Commit

Permalink
Fix timeout on systems with large numbers of loops
Browse files Browse the repository at this point in the history
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]: waveform80/imager-snap#6
  • Loading branch information
waveform80 committed May 21, 2024
1 parent 16c298b commit f4a3b46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/linux/linuxdrivelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f4a3b46

Please sign in to comment.