Skip to content

refactor(simu): make settingsPath a true overlay FS over sdPath#7235

Open
raphaelcoeffic wants to merge 3 commits intomainfrom
simu-overlay-fs
Open

refactor(simu): make settingsPath a true overlay FS over sdPath#7235
raphaelcoeffic wants to merge 3 commits intomainfrom
simu-overlay-fs

Conversation

@raphaelcoeffic
Copy link
Copy Markdown
Member

@raphaelcoeffic raphaelcoeffic commented Mar 30, 2026

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 (w/ copy-on-write for append mode to file existing in sdPath)
  • 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 (see #7234).

raphaelcoeffic and others added 3 commits March 30, 2026 08:20
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>
@raphaelcoeffic raphaelcoeffic added this to the 3.0 milestone Mar 30, 2026
@raphaelcoeffic raphaelcoeffic added enhancement ✨ New feature or request simulator labels Mar 30, 2026
@elecpower
Copy link
Copy Markdown
Collaborator

Testing performed using radio profile TX16SMK3 with sd path configured.
Loaded an etx file containing the model and the linked image.
Ensured the sd path/IMAGES did not contain the linked model image.
Simulated the radio.
Checked terminal output to confirm model image written to the temporary settings directory.
In the sim UI setup.
Screen 1.
Setup widgets.
Added Model Info widget.
Returned from widget settings and model image displayed.
Returned to the main screen.
Model setup
Model settings
Opened model image dropdown and files from settings patch and sd path displayed. Selected a file from the sd path and returned to the main screen and the new image displayed.
Repeated previous step and selected the image on the settings path and that image displayed on the main screen.

Repeated the tests with a file with the same name as the model image but containing different image and saved to sd path/IMAGES.
The dropdown list did no contain duplicates.
The settings path image was displayed when selected from the dropdown.

@elecpower
Copy link
Copy Markdown
Collaborator

Todo test stand alone simulator

@elecpower
Copy link
Copy Markdown
Collaborator

Tested stand alone simulator
File mode where etx file had copy of image. The radio profile sd path had the same file name but a different image. Displayed etx version of the image. Pass
Folder mode using the radio profile sd path. The sd path image displayed. Pass
SD Image Path mode same as Folder mode. Pass

@elecpower
Copy link
Copy Markdown
Collaborator

elecpower commented Mar 31, 2026

Getting some file save errors on closing stand alone simulator. Trying to determine if my environment or code as it was working.

@raphaelcoeffic
Copy link
Copy Markdown
Member Author

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?

@elecpower
Copy link
Copy Markdown
Collaborator

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.

@elecpower
Copy link
Copy Markdown
Collaborator

Found the problem in the save image PR.

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

Labels

enhancement ✨ New feature or request simulator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants