loading scripts into filesystem during build time? #13334
Replies: 3 comments 3 replies
-
There's no built in way currently, though it is planned with vfsmap #8381 However it's possible to convert a binary file into a byte string in a python file that can then be frozen into code. Your app can then just import that module and use the byte string like a read file. |
Beta Was this translation helpful? Give feedback.
-
This what I did to bake in non-python files into a image: https://github.com/bixb922/freezefs This takes a folder with files and subfolders and generates a self-mountable .py file that is frozen together with the rest of the python files. Import the file in boot.py or main.py and the freezefs file system is mounted. |
Beta Was this translation helpful? Give feedback.
-
You can use vfs merge to create and add/include a file system with contents into a firmware image. https://github.com/Josverl/vfs_merge That is the same as if you would copy these files to a file system after flashing, but different from freezing .(m)py files |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a build process set up in a docker container to build micropython from source. During this process I am freezing modules into the build. These work as expected.
But is there a way to bake files into the filesystem? I can use 'ampy' or some other tool to put the files there, but I want them automatically incorporated into the micropython release itself.
Beta Was this translation helpful? Give feedback.
All reactions