Skip to content

mpremote rm -r : behavior in the presence of ROMFS #19199

Description

@Josverl

Description

I have gotten used to mpremote rm -rv : to clear out the filesystem for those boards that do not have an "erase flash" option in the firmware loader.

Recently that has become a stumbling block when device have ROMFS
mpremote then raises : mpremote: rm: ./rom: No such file or directory.
Which is a terminating error - and stops the recursive removal,
and requires subsequent one-by-one removal of the remain files and folders.

(micropython) jos@SB26:~/micropython/tools/mpremote/tests$ mpremote rm -rf :
rm :
mpremote: rm: ./rom: No such file or directory.
(micropython) jos@SB26:~/micropython/tools/mpremote/tests$ mpremote tree
tree :
:/
├── file1.txt
├── file3.txt
├── lib
│   ├── __future__.mpy
│   ├── __future__.py
│   ├── boardname.py
│   ├── createstubs.mpy
│   ├── createstubs.py
│   ├── createstubs_db.mpy
│   ├── createstubs_db.py
│   ├── createstubs_mem.mpy
│   ├── createstubs_mem.py
│   └── modulelist.txt
├── modulelist_exclude.txt
├── petstore.py
├── rom
│   ├── bar.mpy
│   ├── foo.mpy
│   └── vector-text.svg
└── udp_client.py

I think the best way to handle this is for mpremote to:

  • treat this error on a /romxx folder as a non-blocking error , but log it as an error
  • stop traversing that folder
  • continue the rest of the rm -r

Code Size

no FW size impact

Implementation

I intend to implement this feature and would submit a Pull Request if desirable

Code of Conduct

Yes, I agree

Activity

  1. added
    enhancementFeature requests, new feature implementations
    toolsRelates to tools/ directory in source, or other tooling
    on May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature requests, new feature implementationstoolsRelates to tools/ directory in source, or other tooling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions