Mark Linux optical drives as active#981
Conversation
|
|
||
| #region ISO 9660 Filesystem (read directly from the block device) | ||
|
|
||
| private const string Iso9660DriveFormat = "CDFS"; // mirror DriveInfo.DriveFormat on Windows |
There was a problem hiding this comment.
For ISO stuff, there is a lot of support code in SabreTools.Serialization, but that version of the library is not yet included in MPF due to a chain of dependencies. If this can hold on until then, there are many constants and the like that would be at your disposal.
There was a problem hiding this comment.
Sounds good — I've split the ISO reading out of this PR, so it now covers just the disc-present status (MarkedActive). The label/size reading can come back as a follow-up built on SabreTools.Serialization once that's in MPF, rather than the hand-rolled descriptor parser. Thanks for the pointer.
Generated with Claude Opus 4.8.
1dab798 to
df979f7
Compare
|
On the Windows worry: none of these tests touch a real device or The three that model the Linux Generated with Claude Opus 4.8. |
|
At the risk of coming at this from too broad and basic of an angle, I think it may be okay to always just set Linux drives as active. There's a certain level of expectation on users on Linux to even know what those devices are, and just having all of them "available" is fine for now. In my eyes, the bigger issue would be the mounted path for things like information extraction and protection scanning. I don't really know of a good way to expose that in the UI. It's already in CLI as a separate option. |
|
Good point on the mounted path — that's the harder problem, and I'd keep it separate. The filesystem-dependent bits (information extraction, protection scanning) need the mount root rather than the device node, so they don't really belong with the active flag. On the active flag itself: That said, if you'd prefer the simpler always-active path for now, I'm happy to switch it — your call. Generated with Claude Opus 4.8. |
|
One thing I initially missed on my end: on Windows the drive list already includes fixed (and removable) drives when If it'd be welcome, I could look into bringing Linux to parity as a separate follow-up: having the Linux enumeration honor that same Generated with Claude Opus 4.8. |
|
As a followup to both comments above:
|
Linux optical /dev nodes are never mount points, so DriveInfo reports them as not-ready and they were listed but never active. Set /dev/sr* and /dev/sg* active on enumeration, matching how Windows surfaces optical drives, rather than probing each device; whether a disc is loaded is left to the dumping program. This follows the maintainer preference on SabreTools#981 to avoid extra system calls. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
df979f7 to
e56be0c
Compare
|
Switched this to the always-active approach you preferred: all enumerated Generated with Claude Opus 4.8. |
Linux optical
/devnodes are never mount points, soDriveInfoalways reports them as not-ready — they were enumerated but never marked active. This marks all/dev/sr*and/dev/sg*nodes active on enumeration, matching how Windows surfaces optical drives.Per the discussion on this PR, this drops the
CDROM_DRIVE_STATUSioctl approach in favor of always-active to avoid extra system calls. Whether a disc is actually loaded is left to the dumping program. Rebased onto current master, so the change is a small addition inAppendUnixOpticalDrives.Prepared with AI assistance (Claude Opus 4.8) and reviewed before submission.