Specifying the option `--unsafe-links` (or `-l`) to `mpremote mount` will
allow symlinks to be followed in the local directory that point outside of
the base directory path.
For the unsafe case the `path_check()` method of `PyboardCommand` still
checks for a common path but without expanding symlinks. While this check
is currently redundant, it makes the purpose of the method clearer for
possible future uses or extensions.
With the existing code problems can occur with remounting, the "if t -
t_last_activity > QUIET_TIMEOUT:" check can be triggered early before the
REPL string comes through, meaning that the remount doesn't happen.
On certain boards the "MPY: soft reboot" line comes through immediately
(getting the routine past initial timeout) but then there's a slightly
longer delay while the board restarts before it prints out the startup
header and the REPL prompt.
This commit adds some extra pattern monitoring during the timeout loop to
track the state if a soft restart is actually started.
This makes the auto soft-reset behaviour of mpremote more logical, and now
configurable via these new commands.
Signed-off-by: Damien George <damien@micropython.org>
Changes are:
- decision to remount local filesystem on remote device is made only if
"MPY: soft reboot" is seen in the output after sending a ctrl-D
- a nice message is printed to the user when the remount occurs
- soft reset during raw REPL is now handled correctly
Fixes issue #7731.
Signed-off-by: Damien George <damien@micropython.org>
A backslash in the directory name will end up being passed through to the
device and becoming a backslash in a filename, rather than being
interpreted as directories. This makes "cp -r" problematic on Windows.
Changing to simply "/",join() fixes this.
This allows the remote MicroPython instance to create and delete
directories from the mounted host filesystem in addition to the already
existing functionality of reading, creating, and modifying files.
Signed-off-by: Michael Bentley <mikebentley15@gmail.com>
The sys.stdin.buffer and sys.stdout.buffer streams work just as well (and
are just as fast) as pyb.USB_VCP on stm32 devices, so there's no need to
have the USB_VCP specialisation code, which just adds complexity.
Also, on stm32 devices with both USB and UART (or other serial interface),
if something other than the USB_VCP port is used for the serial connection
then mpremote mount will not work because it will default to reading and
writing on USB_VCP instead of the other connected serial stream.
As part of this simplification, support for a second port as input is
removed (this feature was never exposed to the user).
Signed-off-by: Damien George <damien@micropython.org>
Now a ctrl-C will not stop mpremote, rather this character will be passed
through to the attached device.
The mpremote version is also increased to 0.0.5.
Signed-off-by: Damien George <damien@micropython.org>
Using just the list of available ports, instead of a hard-coded list of
possible ports, means that all ports will be available for auto connection.
And the order that they will be attempted in will match what's printed by
"mpremote connect list" (and will be the same as before, trying ACMx before
USBx). Auto-connect will also now work on Mac, and will allow all COM
ports on Windows.
Signed-off-by: Damien George <damien@micropython.org>