Say when a data partition comes out smaller than declared - #386
Closed
anton-vinogradov wants to merge 1 commit into
Closed
Say when a data partition comes out smaller than declared#386anton-vinogradov wants to merge 1 commit into
anton-vinogradov wants to merge 1 commit into
Conversation
An empty filesystem gets LAUNCHER_DEFAULT_SPIFFS_SIZE whatever its manifest or partition table asked for. That is the right default — most images on M5Burner are whole-flash dumps whose spiffs is empty and enormous, and honouring those would hand out megabytes of nothing. But a firmware genuinely built around a larger filesystem gets shrunk in silence, and the only way to find out is to read back your own partition table afterwards. That is how I found it: installing a firmware that declares 1.5 MB of LittleFS for user data, which arrived as 448 KB. The install reported success and there was nothing anywhere to suggest the difference. One line on the console at the point the size is chosen, in all three paths that choose it. No decision changes; the same size is allocated as before. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
An empty filesystem is given
LAUNCHER_DEFAULT_SPIFFS_SIZEregardless of the size its manifest or partition table declared. That default is right, and this PR does not change it — as you pointed out on #377, most images on M5Burner are whole-flash dumps whose spiffs is empty and huge, and honouring those would hand out megabytes of nothing.What it changes is that the shrink is currently silent. A firmware genuinely built around a larger filesystem is installed successfully, reports nothing unusual, and runs with a third of the space it was built for. The only way to discover it is to read your own partition table back afterwards, which is exactly how I found it:
So: one console line where the size is chosen, in all three paths that choose it (manifest, SD, web). Same allocation as before, just no longer a surprise.
Built for
m5stack-cardputer.Separately, and not part of this PR: is there a way you would want a firmware to say "this filesystem is empty, but I need N bytes"? Right now
sizewithcopy_size = 0is indistinguishable from a dump's leftovers, which is what forces the label exceptions you mentioned forfont. If you have a shape in mind — a manifest flag, an install-time prompt, a size ceiling — I am happy to implement it. If you would rather keep the label list, that is a fine answer too and this PR stands on its own.