Files
Ned Konz 7090fc5dd6 zephyr: Mount all disks and flash partition, formatting if necessary.
Existing C code in `main.c` only mounts a flash filesystem if one exists,
and doesn't do anything if the 'storage' partition is not formatted.

This commit moves the mounting logic from `main.c` to frozen code using
`modules/_boot.py` and adds the formatting of a previously unformatted
partition if the mount fails.

Every available disk (in the newly added `DiskAccess.disks` tuple) will be
mounted on separate mount points (if they're formatted), and the 'storage'
flash partition (if any) will be mounted on /flash (and will be formatted
as LFS2 if necessary).

Also, `sys.path` will be updated with appropriate 'lib' subdirectories for
each mounted filesystem.

The current working directory will be changed to the last `DiskAccess.disk`
mounted, or to /flash if no disks were mounted.

Then `boot.py` and `main.py` will be executed from the current working
directory if they exist.

Thanks to @VynDragon for the logic in `zephyr/zephyr_storage.c`.

Signed-off-by: Ned Konz <ned@metamagix.tech>
2025-10-22 10:22:48 +11:00
..