From 701f03ec94517d97ed456061e4d98a1917457e39 Mon Sep 17 00:00:00 2001 From: Dmytro Aleksandrov Date: Sun, 29 Sep 2024 14:26:44 -0400 Subject: [PATCH] Explicitly add '--tree' to the lsblk to remove partitions from top level output After trimming the lsblk output by listing only required columns (see [1]), the output includes not only the disk devices, but also their partitions, which significantly clutters the device selection dialog. This happens becuase the "--output" argument [2] defaults to using "--tree", but only if the column "NAME" is outputed, which in current state doesn't (only "kname" is used). So that all child elements (e.g. partitions) are listed on the same level with disk devices. Thus ist's proposed to explicitly add "--tree" argument, so that we don't rely on lsblk CLI intricacies [1] https://github.com/raspberrypi/rpi-imager/commit/baae3c76417cde5c7a38b37400a016f7e7cdb5d1 [2] https://www.mankier.com/8/lsblk#--output --- src/linux/linuxdrivelist.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/linux/linuxdrivelist.cpp b/src/linux/linuxdrivelist.cpp index f97920a..2fcf852 100644 --- a/src/linux/linuxdrivelist.cpp +++ b/src/linux/linuxdrivelist.cpp @@ -52,6 +52,7 @@ namespace Drivelist "--bytes", "--json", "--paths", + "--tree", "--output", "kname,type,subsystems,ro,rm,hotplug,size,phy-sec,log-sec,label,vendor,model,mountpoint", "--exclude", "7" };