summaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-02-21 11:34:09 +1100
committerDamien George <damien@micropython.org>2025-03-06 12:52:35 +1100
commit840b641024cffd0b4e3f941e53c699c699c21811 (patch)
treefd7fa30c8e5c0df39801d8368104643d6dace842 /py/runtime.c
parentd4b8ca2ffc3967007297d17e995d955ca39b1d6d (diff)
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>
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c
index bf26921f9..58819819a 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -46,6 +46,10 @@
#include "py/cstack.h"
#include "py/gc.h"
+#if MICROPY_VFS_ROM && MICROPY_VFS_ROM_IOCTL
+#include "extmod/vfs.h"
+#endif
+
#if MICROPY_DEBUG_VERBOSE // print debugging info
#define DEBUG_PRINT (1)
#define DEBUG_printf DEBUG_printf
@@ -185,6 +189,11 @@ void mp_init(void) {
#endif
MP_THREAD_GIL_ENTER();
+
+ #if MICROPY_VFS_ROM && MICROPY_VFS_ROM_IOCTL
+ // Mount ROMFS if it exists.
+ mp_vfs_mount_romfs_protected();
+ #endif
}
void mp_deinit(void) {