My interpretation of the documentation is that the boot file system (/flash or /sd) is where it first finds <boot.py> and <main.py>, starting the search with /sd if it exists, and that you can force /sd to be skipped and thus use /flash by either removing the SD card or putting an empty SKIPSD file on /flash, but that comes with the caveat that /sd will not be mounted if the SD card is present, but can be later mounted with os.mount.
So couldn't the same thing be done by simply renaming the <boot.py> file on /sd to something else? Would that force /flash to be the current directory so that the code on /flash would be used instead of code on /sd, while at the same time having /sd mounted and thus avoid having to use os.mount?
boot file system and SKIPSD
Re: boot file system and SKIPSD
Looking at the source code: https://github.com/micropython/micropyt ... ain.c#L643
It either adds /sd and /sd/lib OR /flash and /flash/lib to sys.path. It will look for boot.py and main.py in the paths shown in sys.path.
It either adds /sd and /sd/lib OR /flash and /flash/lib to sys.path. It will look for boot.py and main.py in the paths shown in sys.path.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: boot file system and SKIPSD
I think SKIPSD is a security feature to prevent a hostile user fitting an SD card containing their own code.smhodge wrote: ↑Thu Sep 03, 2020 5:01 pm...
So couldn't the same thing be done by simply renaming the <boot.py> file on /sd to something else? Would that force /flash to be the current directory so that the code on /flash would be used instead of code on /sd, while at the same time having /sd mounted and thus avoid having to use os.mount?
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.