extmod/vfs_lfsx: Allow overriding the LFS2 on-disk version format. #17565
+6
−0
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
Back in LFS2 version 2.6 they updated the on-disk version from 2.0 to 2.1 which broke back compatibility (aka older versions could no long read new version disk format) https://github.com/littlefs-project/littlefs/releases/tag/v2.6.0
Then in LFS2 v2.7 an optional
config->disk_version
was added to force the library to use an older disk format instead: https://github.com/littlefs-project/littlefs/releases/tag/v2.7.0I've got an stm32wb55 application where I'm using current micropython, however units are already in the field with a mboot bootloader from an older version with v2.5 LFS2, so can only read the older disk format when using fsload.
This PR simply exposes
config->disk_version
as a compile time option ifLFS2_MULTIVERSION
is set, otherwise there is no change in behavior.Note: LFS2_MULTIVERSION needs to be defined at the
make
/CFLAGS
level, setting it inmpconfigboard.h
doesn't work as it's not included in the lfs2.c file in any way.Testing
This has been tested with and stm32wb55 build using mboot from a much older version. The on-disk format change can be seen by changing the
LFS2_MULTIVERSION
setting, once it's set to0x00020000
any existing partitions cannot be mounted and need to be reformatted.After it was reformatted and a dfu file was copied on, I was able to use mboot fsload again to flash it.