summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-03-11 14:52:15 +1100
committerDamien George <damien@micropython.org>2025-03-27 17:10:00 +1100
commit2db0c0225f41292f85b2cf49257d663856d5c8db (patch)
treee16d6452112305734f0c15ce3fb8841ccb0e9e67
parente4051a1ca66703090383678a1747c3f99e993309 (diff)
tools/mpremote: Make mip install skip /rom*/lib directories.
If a ROMFS is mounted then "/rom/lib" is usually in `sys.path` before the writable filesystem's "lib" entry. The ROMFS directory cannot be installed to, so skip it if found. Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--tools/mpremote/mpremote/mip.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/mpremote/mpremote/mip.py b/tools/mpremote/mpremote/mip.py
index 858b7933d..26ae8bec5 100644
--- a/tools/mpremote/mpremote/mip.py
+++ b/tools/mpremote/mpremote/mip.py
@@ -175,7 +175,11 @@ def do_mip(state, args):
if args.target is None:
state.transport.exec("import sys")
- lib_paths = [p for p in state.transport.eval("sys.path") if p.endswith("/lib")]
+ lib_paths = [
+ p
+ for p in state.transport.eval("sys.path")
+ if not p.startswith("/rom") and p.endswith("/lib")
+ ]
if lib_paths and lib_paths[0]:
args.target = lib_paths[0]
else: