refactor(simu): make settingsPath a true overlay FS over sdPath#7235
refactor(simu): make settingsPath a true overlay FS over sdPath#7235raphaelcoeffic wants to merge 3 commits intomainfrom
Conversation
Replace the prefix-based path routing (/RADIO, /MODELS → settingsPath, everything else → sdPath) with a true overlay filesystem where settingsPath is layered on top of a read-only sdPath: - Reads: resolve in settingsPath first, fall back to sdPath - Writes: always go to settingsPath - Directory listings: merge entries from both layers, settingsPath wins on case-insensitive duplicates - Parent directories are auto-created in settingsPath only when they exist in at least one layer, preserving accurate FAT FS semantics This enables Companion to provide files (e.g. model images in /IMAGES) in settingsPath while still seeing files from sdPath in the same directories. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a file exists only in sdPath and is opened for writing (without FA_CREATE_ALWAYS), copy it to settingsPath first so that appends start from the original content instead of an empty file. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Testing performed using radio profile TX16SMK3 with sd path configured. Repeated the tests with a file with the same name as the model image but containing different image and saved to sd path/IMAGES. |
|
Todo test stand alone simulator |
|
Tested stand alone simulator |
|
Getting some file save errors on closing stand alone simulator. Trying to determine if my environment or code as it was working. |
What kind of errors exactly? It cannot save the model/radio files? |
Saving the images is failing and it appears it always was but until I improved the checks and debug messages it was silently failing and continuing. Well better to find that now. |
|
Found the problem in the save image PR. |
Replace the prefix-based path routing (/RADIO, /MODELS → settingsPath, everything else → sdPath) with a true overlay filesystem where settingsPath is layered on top of a read-only sdPath:
This enables Companion to provide files (e.g. model images in /IMAGES) in settingsPath while still seeing files from sdPath in the same directories (see #7234).