Conversation
On a device with two microSD cards, find_games scans for the external card once. When the card has not enumerated yet at that moment (a cold boot, a card that is slow to come up), the scan finds nothing and the script binds the internal card over /storage/roms. Anything written to /storage/roms during that boot -- a cloud restore of game saves, a save written by a game -- lands on the internal card, where it lingers and later reads as that device's newest data. Observed on an RG SP: 101 stale save files on the internal card with both cards inserted the whole time. find_games now retries the scan when the device expects an external card: system.merged.device is external (it has mounted one before) or system.gamesdevice is pinned. It waits only while a candidate block device is actually present but not yet readable -- a non-internal disk over ~8 GB under /sys/block -- so a card that was removed has no node and boot falls back to internal after a two-second grace; the ceiling is 10 seconds and is paid only by a card that never becomes readable. A one-card device has neither signal and does not wait. Boot cost, verified against the real functions with mocked block devices: card present and ready 0 s; card present but slow, its own lateness; card removed 2 s; one-card device 0 s; card present but never readable 10 s then internal. The helper's sed expressions are single-quoted: a double-quoted "s#p[0-9]*$##" had bash expand $# and broke the command.
13 tasks
maxengel
added a commit
to maxengel/rocknix
that referenced
this pull request
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On a device with two microSD cards,
automount'sfind_gamesscans for the external games card once. When the card has not enumerated yet at that moment (a cold boot, a card slow to come up), the scan finds nothing and the script binds the internal card over/storage/roms. Anything written to/storage/romsduring that boot — game saves, a restore — lands on the internal card, where it lingers and later reads as that device's newest data. Observed on an Anbernic RG SP: 101 stale save files on the internal card with both cards inserted the whole time.Fix
find_gamesretries the scan when the device expects an external card —system.merged.deviceisexternal(it has mounted one before) orsystem.gamesdeviceis pinned. It waits only while a candidate block device is physically present but not yet readable (a non-internal disk over ~8 GB under/sys/block), so:A one-card device has neither signal and never waits. The helper's sed expressions are single-quoted: a double-quoted
"s#p[0-9]*$##"had bash expand$#.Testing
find_gamesbody run under mocked block devices for the seven situations above (card present, card late, card removed, one-card, unset setting, pinned device with a late card, present-but-unreadable): each falls where the table says.No user-facing option or documentation changes.