If there is more than a single flash device / SD card, /sd0, /sd1 etc could be used.
The drawback here is that there can’t be a generic application that works both on boards with an SD card and with SPI flash as those use different mount points.
Create mountpoints strictly alphabetically, first device is /a, second device is /b etc.
A drawback here is that the application now can’t know if a device is an SD card (and thus removable) or not. Maybe this is a minor issue.
In the very first iteration I also had
Variant C
Only allow for a single default mount per board and mount it to /.
Every additional device would need a board-specific mount point.
What do you think makes the most sense?
Another idea is to provide bind mounts in VFS so devices could be mounted under different names at the same time.
I like variant a), but always using a numeric postfix (e.g. /sd0 even when there is only a single sd card). Distinguishing between when there is only one or more than one instances of a specific storage item sounds like extra complexity without real benefit to me.
Contrasting it to B, I’d expect that applications (through their usage patterns, eg. expecting fast access or expecting almost infinite storage) will have a typical mountpoint class to use, and while switching between them should be possible (to the extent supported by the hardware and atomicity requirements), that might be better left to the user / application designer who is then also aware of this not being used “on its home turf”.
When describing this, it should be pointed out that this is a default that applications can override, and modules need to be prepared to take custom paths.
Does it also make sense to have a configurable directory where to auto-mount? So something like /media or just /m for brevity (but keep / by default for now). Not that I see it realistically, but I want to prevent that we run into a cluttered root at some point.
I think the defaut device should not be / (not Var-C)
But should have a common name (not /sd for one type and /nvm for another (sd-cards are also no volatile memory so vm would apply to both))
/data would be nice or /d to keep the string short.
with my suggestion i did not think about extra devices than the one default (so no /e, /f).
The one default device should be choosen either by the Board
(e.g. there is nvm on board → nvm is i good default since it is allways there;
there is no nvm but a sd-slot sd is a good default
-there are mutiple nvm but some are only supplied in some variants → use the one that is allways there
for USEMODULE = vfs_mount_default i would expect a place i know to be able to write to without knowing what board i choose
if there are multiple storrages they can be mounted using the fstab-alike
I feel like shortening “/data” and “/media” to “/d” and “/m” is not worth the bytes. so much user visibility and room for confusion. let’s rather take 16 bytes from the default stack size…
if i want to add a device i add that info to fstab, but when i install nearly any linux the above holds true, even if my root did not get mounted and i find myself in an initrd / the above hold true
It might be good to say that if there is some additional/extraneous to required needs, that it get mounted into something like “/var” (maybe /v), where one could direct debugging.
Folks, this is all not about setting a structure in stone, and certainly not about narrowing what an application can do, or about specifying where applications put their data.
The convention is for the benefit of the user, who should be able to make heads and tails of what they get when running the filesystem example, and for the benefit of board-generic demo applications and tutorials where you write “get a RIOT board with an SD card” and the example works, and not “and then look up where your board happens to mount the storage, and adjust the CFLAGS accordingly”.
Where to place configuration, whether file systems even make sense for configuration, and where data of individual users goes is certainly interesting when comparing all this to POSIX, but AIU not the scope of this thread.
An actual application will, until much further ahead, just pick the mount points for the MTDs which it needs anyway.