fix: remount the SD card read-only before poweroff - #239
Open
dime-online wants to merge 1 commit into
Open
Conversation
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.
Summary
sync, closes inherited standard streams and uses a system-onlyPATH/dev/mmcblk0p1at/mnt/SDCARD/sbin/poweroffaction whether the remount succeeded or failedScope
This is for SprigUI's supported Miyoo Mini Flip target. The Mini OG reboot path is unchanged.
SprigUI keeps SD-backed bind mounts active during shutdown. A direct adaptation of full spruceOS's RAM stage/unmount flow was tested on the Mini Flip and froze before the RAM stage started, so this change intentionally leaves those binds readable and remounts only the base FAT volume read-only.
Root cause
The normal software-shutdown path synced the filesystem and immediately called
poweroff, but never transitioned the FAT volume out of its writable state. On a Miyoo Mini Flip, documented quick-save shutdowns could leave the card dirty even thoughsave_poweroff.shcompleted normally. A vfat read-only remount commits the FAT clean-state transition while leaving SprigUI's bind-mounted runtime files readable for the firmware handoff.The failure path deliberately retains stock behavior: it still powers off rather than freezing the UI and forcing a hard cut. Everything through autoresume capture, process signaling/waits, and the original
syncis byte-identical to the currentdevelopmentscript. This does not add a second-stage shutdown script or import the different spruceOS shutdown topology.Validation
sh -nand Git whitespace checksNOT DirtyandHealthy/OK; read-only CHKDSK found no filesystem errorsFixes #236