Rpi-imager snap displays root storage

Came across an interesting issue when testing the rpi-imager snap. The application is pretty simple: select an image, select a target device, hit the button and it’ll flash and verify the image. However, there seems to be a slight difference in the target device selection dialog depending on whether the application was installed from a .deb or the snap.

This dialog nicely avoids displaying the root device (obviously intended to avoid users accidentally flashing their root drive). When installed from the deb, this operates correctly (only shows the SD card available for flashing) on all machines on which I’ve tried it.

When installed from the snap, this also operates correctly on my desktop PC (in which the internal storage is an SSD). However, on my laptop (in which the internal storage is a 64Gb eMMC) the following appears:

Screenshot%20from%202020-04-02%2020-36-31

The top item in the dialog is the internal storage on the laptop (which doesn’t appear when the application is deb installed). I’m not sure if the application would actually permit me to flash the internal storage on the laptop, but nor am I particularly keen to try it and see :slight_smile:

Might this be some effect of the containment of the snap, with the application perhaps not knowing that the internal storage device is actually mounted somewhere?

I’ve had a quick look at the application’s source and the linuxdrivelist.cpp unit looks vaguely relevant in terms of enumerating devices but I didn’t yet find where the actual filtering is done so I can’t point to a definite difference in the two environments.

Any ideas welcome!

rpi-imager comes with a lot of non-connected interfaces, perhaps an additional auto-connection is needed …

i’d try to connect them manaually and see if the app then detects more info about your rootfs … i.e. i could imagine mount-observe giving some extra info about it being mounted as rootfs …

I’ve had a play with this now but no joy so far. Adding the connection for :mount-observe did permit the application to see the mount points for things (and display them):

Screenshot%20from%202020-04-17%2000-21-28

So it’s probably worth adding that as an auto-connection as it at least gives the user a bit more information but as can be seen in the screenshot above, it does still display the internal drive.

I then added :removable-media, :cifs-mount, :network-control, and :network-manager in turn (I realize the last three were unlikely, but just in case!). I’ll try and find some time to have another dig into the source and see if I can figure out where it’s doing its filtering.

2 Likes