[UDisks2] Use MediaRemovable to determine if media can be ejected
ClosedPublic

Authored by bruns on Jan 2 2019, 1:41 AM.

Details

Summary

The Ejectable property is mostly useless for card readers and thumb drives.
It directly exposes a flag from the kernel, e.g. /sys/block/sdX/removable,
which is the "removable bit" value from the SCSI INQUIRY response.

Unfortunately, most vendors get this wrong, i.e. many thumb drives have
the removable bit set, while some card readers have it cleared.

The MediaRemovable bit defaults to the same value, but can be overridden
by setting the ID_DRIVE_THUMB respectively ID_DRIVE_FLASH_{SD,CF,MS}
properties. UDisks ships a rules file with a large number of devices
already.

Bug: 402096

Test Plan

Thumb drive - powered down
Card reader - ejected, stays powered
External hard driver - powered down

Diff Detail

Repository
R245 Solid
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Jan 2 2019, 1:41 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 2 2019, 1:41 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Jan 2 2019, 1:41 AM
ngraham accepted this revision.Jan 2 2019, 2:38 AM
This revision is now accepted and ready to land.Jan 2 2019, 2:38 AM
This revision was automatically updated to reflect the committed changes.