Skip to content

Conversation

@iabdalkader
Copy link
Contributor

Summary

Currently the tool allows writing invalid romfs image, with a bad header or images smaller than minimum size, and only checks the image extension.
This patch allows deploying romfs with any extension, and validates the image header and minimum size before writing.

Testing

Before this patch, I tested deploying 1 byte images, or all zero images, and in both cases the tool deploys them as long as they have the correct extension. Deeper validation could be performed in both the tool and runtime, as I've encountered a runtime issue with a corrupted image (during development) at least once.

@codecov
Copy link

codecov bot commented Mar 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.54%. Comparing base (74a5bf9) to head (9e9be83).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #17037   +/-   ##
=======================================
  Coverage   98.54%   98.54%           
=======================================
  Files         169      169           
  Lines       21890    21890           
=======================================
  Hits        21571    21571           
  Misses        319      319           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@dpgeorge dpgeorge added the tools Relates to tools/ directory in source, or other tooling label Apr 1, 2025
@iabdalkader iabdalkader force-pushed the fix_mpremote_romfs_path branch 4 times, most recently from 99246a5 to 8db75a8 Compare April 7, 2025 08:50
@iabdalkader iabdalkader force-pushed the fix_mpremote_romfs_path branch from 8db75a8 to 807229f Compare April 7, 2025 14:11
Currently the tool allows writing an invalid ROMFS image, with a bad header
or images smaller than minimum size, and only checks the image extension.

This commit allows deploying a ROMFS with either a ".img" or ".romfs"
extension (in the future support may be added for other extensions that
have different semantics, eg a manifest), and validates the image header
before writing.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
@dpgeorge dpgeorge force-pushed the fix_mpremote_romfs_path branch from 807229f to 9e9be83 Compare April 7, 2025 14:31
@dpgeorge dpgeorge merged commit 9e9be83 into micropython:master Apr 7, 2025
63 checks passed
@iabdalkader iabdalkader deleted the fix_mpremote_romfs_path branch April 7, 2025 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools Relates to tools/ directory in source, or other tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants