From b00815058f63e6782c9480074075588d1704f77e Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 21 May 2024 16:01:17 +0100 Subject: [PATCH] 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 --- src/linux/linuxdrivelist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linux/linuxdrivelist.cpp b/src/linux/linuxdrivelist.cpp index 89e6d93..85e0549 100644 --- a/src/linux/linuxdrivelist.cpp +++ b/src/linux/linuxdrivelist.cpp @@ -48,7 +48,7 @@ namespace Drivelist std::vector 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();