aboutsummaryrefslogtreecommitdiff
path: root/ports/unix/mpconfigport.h
diff options
context:
space:
mode:
authorDamien George2018-06-06 13:15:04 +1000
committerDamien George2018-06-06 14:28:23 +1000
commit1d40f12e44afcd0ac13fd78598098298831e254e (patch)
tree4af2ea92744463380cc4fa94fe05b142904efcfe /ports/unix/mpconfigport.h
parentd4ce57e4e320a717db1a231f2e6c1e92afaafde0 (diff)
unix: Support MICROPY_VFS_POSIX and enable it in coverage build.
The unix coverage build is now switched fully to the VFS implementation, ie the uos module is the uos_vfs module. For example, one can now sandbox uPy to their home directory via: $ ./micropython_coverage >>> import uos >>> uos.umount('/') # unmount existing root VFS >>> vfs = uos.VfsPosix('/home/user') # create new POSIX VFS >>> uos.mount(vfs, '/') # mount new POSIX VFS at root Some filesystem/OS features may no longer work with the coverage build due to this change, and these need to be gradually fixed. The standard unix port remains unchanged, it still uses the traditional uos module which directly accesses the underlying host filesystem.
Diffstat (limited to 'ports/unix/mpconfigport.h')
-rw-r--r--ports/unix/mpconfigport.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h
index f0e17ccad..016dabf9f 100644
--- a/ports/unix/mpconfigport.h
+++ b/ports/unix/mpconfigport.h
@@ -180,9 +180,9 @@ extern const struct _mp_obj_module_t mp_module_ffi;
extern const struct _mp_obj_module_t mp_module_jni;
#if MICROPY_PY_UOS_VFS
-#define MICROPY_PY_UOS_VFS_DEF { MP_ROM_QSTR(MP_QSTR_uos_vfs), MP_ROM_PTR(&mp_module_uos_vfs) },
+#define MICROPY_PY_UOS_DEF { MP_ROM_QSTR(MP_QSTR_uos), MP_ROM_PTR(&mp_module_uos_vfs) },
#else
-#define MICROPY_PY_UOS_VFS_DEF
+#define MICROPY_PY_UOS_DEF { MP_ROM_QSTR(MP_QSTR_uos), MP_ROM_PTR(&mp_module_os) },
#endif
#if MICROPY_PY_FFI
#define MICROPY_PY_FFI_DEF { MP_ROM_QSTR(MP_QSTR_ffi), MP_ROM_PTR(&mp_module_ffi) },
@@ -221,8 +221,7 @@ extern const struct _mp_obj_module_t mp_module_jni;
MICROPY_PY_UTIME_DEF \
MICROPY_PY_SOCKET_DEF \
{ MP_ROM_QSTR(MP_QSTR_umachine), MP_ROM_PTR(&mp_module_machine) }, \
- { MP_ROM_QSTR(MP_QSTR_uos), MP_ROM_PTR(&mp_module_os) }, \
- MICROPY_PY_UOS_VFS_DEF \
+ MICROPY_PY_UOS_DEF \
MICROPY_PY_USELECT_DEF \
MICROPY_PY_TERMIOS_DEF \