Skip to content

Commit 840b641

Browse files
committed
py/runtime: Automatically mount ROMFS as part of mp_init.
This is put in `mp_init()` to make it consistent across all ports. Signed-off-by: Damien George <damien@micropython.org>
1 parent d4b8ca2 commit 840b641

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

py/runtime.c

+9
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
#include "py/cstack.h"
4747
#include "py/gc.h"
4848

49+
#if MICROPY_VFS_ROM && MICROPY_VFS_ROM_IOCTL
50+
#include "extmod/vfs.h"
51+
#endif
52+
4953
#if MICROPY_DEBUG_VERBOSE // print debugging info
5054
#define DEBUG_PRINT (1)
5155
#define DEBUG_printf DEBUG_printf
@@ -185,6 +189,11 @@ void mp_init(void) {
185189
#endif
186190

187191
MP_THREAD_GIL_ENTER();
192+
193+
#if MICROPY_VFS_ROM && MICROPY_VFS_ROM_IOCTL
194+
// Mount ROMFS if it exists.
195+
mp_vfs_mount_romfs_protected();
196+
#endif
188197
}
189198

190199
void mp_deinit(void) {

0 commit comments

Comments
 (0)