-
Notifications
You must be signed in to change notification settings - Fork 7.7k
feat(update): Allow updating any type of file system #11856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
👋 Hello me-no-dev, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds support for updating multiple file system types via OTA (Over-The-Air) updates, expanding beyond the previous SPIFFS-only capability to include FATFS, LittleFS, and a generic file system mode. The changes refactor the update logic to use specific constants for each file system type and introduce new API methods for targeted file system updates.
Key changes include:
- Added new constants (
U_FLASHFS
,U_FATFS
,U_LITTLEFS
) and refactored existingU_SPIFFS
constant - Introduced new update methods for each file system type in HTTPUpdate API
- Enhanced partition selection logic with fallback mechanisms for generic file system updates
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
libraries/Update/src/Update.h | Adds new file system type constants and removes unused _paroffset member |
libraries/Update/src/Updater.cpp | Implements multi-file system partition selection logic and removes offset handling |
libraries/HTTPUpdate/src/HTTPUpdate.h | Declares new file system-specific update methods |
libraries/HTTPUpdate/src/HTTPUpdate.cpp | Implements file system-specific update methods and refactors internal handling |
libraries/HTTPUpdateServer/src/HTTPUpdateServer.h | Updates example to use generic file system mode |
libraries/Update/examples/HTTP_Server_AES_OTA_Update/HTTP_Server_AES_OTA_Update.ino | Updates example and documentation to use generic file system mode |
libraries/ArduinoOTA/src/ArduinoOTA.cpp | Updates OTA command validation to accept generic file system mode |
Comments suppressed due to low confidence (1)
libraries/Update/src/Updater.cpp:313
- [nitpick] Missing whitespace after the closing brace. There should be a blank line before the next statement for better code readability and consistency with the surrounding code structure.
}
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Test Results 76 files 76 suites 13m 53s ⏱️ Results for commit 69c974f. ♻️ This comment has been updated with latest results. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
This pull request adds support for updating multiple file system types via OTA (Over-The-Air) updates, refactors the update logic to generalize file system handling, and introduces new update methods for various file systems. The changes improve flexibility and maintainability by replacing the previous SPIFFS-only logic with support for SPIFFS, FATFS, LittleFS, and a generic file system mode. Additionally, several code cleanups and refactorings are included.
File System OTA Update Support:
U_FLASHFS
,U_FATFS
,U_LITTLEFS
) toUpdate.h
to represent different file system OTA update modes, and refactored code to use these instead of onlyU_SPIFFS
.UpdateClass::begin
method and OTA partition selection logic to support SPIFFS, FATFS, LittleFS, and a generic file system mode (U_FLASHFS
), including fallback logic for partition selection.handleUpdate
method inHTTPUpdate.cpp
to accept a file system type parameter instead of a boolean, and to set appropriate HTTP headers and select the correct partition for each file system type. [1] [2] [3] [4] [5]API Additions and Refactoring:
updateFs
,updateFatfs
,updateLittlefs
) to bothHTTPUpdate.h
andHTTPUpdate.cpp
, for bothNetworkClient
andHTTPClient
usage. [1] [2]Code Cleanup and Documentation:
_paroffset
member fromUpdateClass
and related logic, simplifying partition offset handling. [1] [2]U_FLASHFS
) instead of SPIFFS. [1] [2]Backward Compatibility and Generalization:
Updater.cpp
to work for all file system types, not just SPIFFS. [1] [2]These changes collectively make the OTA update process more robust and extensible for different file system types on ESP32 platforms.
Fixes: #9347