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] baae3c7641
[2] https://www.mankier.com/8/lsblk#--output
Rather than using all possible output from lsblk -
which in testing produces ~45k of output on
Raspberry Pi 5 running Bookworm, instead constrain
to just the fields we actually use - just over 8k on the same system.
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
Add " %F" to the Exec parameter in the rpi-imager.desktop file so that
Linux desktop environments know that rpi-imager can be used to open
files. After this change, Imager appears within the list of "Open With"
applications in GNOME, and you can set it so double-clicking image files
always opens rpi-imager.
Otherwise it may still be doing it during ejection, resulting
in read IO errors in dmesg, which are harmless by themselves
but may confuse users.
Also tell udisks2 not to analyze disk by setting 'HintAuto'
property on BlockDevice object to 'false'
- Reduce platform specific code in ImageWriter class,
and move that to seperate classes.
- Use API calls to get current SSID on Windows and Linux instead
of launching command line utilities.
Only supported when NetworkManager is used on the Linux distro
as wpa_supplicant itself does not support reading PSKs through
DBus, only setting them.
Closes#457