Skip to content

Ignore drives with .rpiignore - #1579

Open
andydvsn wants to merge 1 commit into
raspberrypi:mainfrom
birdslikewires:main
Open

Ignore drives with .rpiignore#1579
andydvsn wants to merge 1 commit into
raspberrypi:mainfrom
birdslikewires:main

Conversation

@andydvsn

@andydvsn andydvsn commented Apr 6, 2026

Copy link
Copy Markdown

Really simple request; I'd like the Imager to never show me external drives which have an .rpiignore file at the root.

The reason is that I have an external drive permanently attached to my Mac, and every time I use the Imager I'm paranoid I'll zap this drive by mistake. It hasn't happened yet! But a simple check for this empty file on the root would make me a lot happier, and I think others may find it helpful too.

@lurch

lurch commented Apr 6, 2026

Copy link
Copy Markdown
Collaborator

IIRC this processDriveList function gets called repeatedly while Imager is open, so that it can check for removable drives being added or removed. So if this code is constantly checking for this file of every drive, I guess that would prevent any of the drives connected to the system from going to sleep while Imager is open? (Assuming of course that the OS doesn't cache that information)

@tdewey-rpi

Copy link
Copy Markdown
Collaborator

While this isn't an unreasonable change on the face of it, there is a performance consideration to bear in mind on Linux systems that may have many mounted devices (in particular, I note AppImages, Snaps & Flatpaks could lead to this scenario).

As such, I can't merge this until I've observed the performance impact. It may be we need to cache the mountpoint file existence records - or possibly approach this by introducing a UI element and performing an inverted search.

@lurch

lurch commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

And of course this also assumes that the partition containing the .rpiignore file remains mounted at all times. If the partition was ever unmounted without the drive being unplugged (which I guess is less likely on macOS or Windows than it is on Linux?), then Imager would happily display the drive again.

@andydvsn

andydvsn commented May 1, 2026

Copy link
Copy Markdown
Author

All very good points. I should never have used the word "simple". ;)

@lurch

lurch commented May 5, 2026

Copy link
Copy Markdown
Collaborator

@andydvsn I guess you might be able to partially-placate Tom's performance concerns by moving your check to later in the function, e.g. after the if (i.isVirtual) checks? That way all the "light-weight" checks get run first, and your "heavy-weight" check only gets run if all the light-weight checks have already passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants