From 2db0c0225f41292f85b2cf49257d663856d5c8db Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 11 Mar 2025 14:52:15 +1100 Subject: [PATCH] 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 --- tools/mpremote/mpremote/mip.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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: