Skip to content

LFSv2 + Chunked Contacts#2964

Draft
oltaco wants to merge 16 commits into
meshcore-dev:devfrom
oltaco:lfs2-chunked-contacts
Draft

LFSv2 + Chunked Contacts#2964
oltaco wants to merge 16 commits into
meshcore-dev:devfrom
oltaco:lfs2-chunked-contacts

Conversation

@oltaco

@oltaco oltaco commented Jul 15, 2026

Copy link
Copy Markdown
Member

This PR upgrades all LFSv1 filesystems (including UserData) to LFSv2, and in the case of ExtraFS it will reformat to 4kB blocks as well.
The monolithic contacts file is converted into chunks that each fit into a single 4kB block, and all file writes are atomic.
Identity and preferences are migrated to ExtraFS/QSPIFlash, and a "backup" copy of identity is left on UserData just in case. At load time if an identity can't be found on the storage filesystem (ExtraFS/QSPIFlash) an attempt is made to restore identity from UserData.

adv_blobs doesn't make the migration from ExtraFS because there isn't enough space in RAM to store it during the reformat to 4kB blocks. adv_blobs is basically treated as ephemeral data anyway so this shouldn't be an issue.

Maximum adv_blobs is reduced from 100 to 40 in order to free up a few blocks for the overhead required for atomic writes and the metadata compaction that happens occasionally on LFSv2. Could be increased to 45 without any extra block overhead.

I've done quite a bit of testing on nRF (Seeed WioTrackerL1, Seeed T1000e, Heltec T114, Xiao NRF52, and others), and also a limited amount of testing on ESP32, RP2040 and STM32.

Something this huge really needs a lot of testing, so please help out if you're game.

Please add the debug macros-D MESH_DEBUG=1 and -D CFG_DEBUG=1 in order to get useful debug prints, especially for the first boot migration process which is where I anticipate issues might be lurking.

Best effort is made to migrate your data but better to be safe than sorry, and switching back to any firmware that doesn't support LFSv2 will wipe your filesystems!

Please backup your node before testing this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant