feat(ota): add partition-table signature handling for OTA updates
Implemented functionality to generate and compare partition-table signatures during OTA updates. This enhancement ensures that the target build's partition layout matches the device's actual layout, improving the reliability of OTA updates and preventing issues related to partition changes.
This commit is contained in:
1 parent
a6851813f9
commit
125ddac184
7 files changed
+169
-11
No files matched your search
@@ -1452,10 +1452,11 @@ void MyMesh::loop() {
|
||||
// headroom, then flash: otaFromManifest reboots into the new image on success
|
||||
// (so this never returns); on any abort (already up to date, partition change,
|
||||
// download error) it returns and we resume the bridge.
|
||||
Serial.println("OTA: starting update");
|
||||
setBridgeState(false);
|
||||
char ota_reply[160];
|
||||
if (!_cli.getBoard()->otaFromManifest(getFirmwareVer(), false, ota_reply)) {
|
||||
MESH_DEBUG_PRINTLN("ota update aborted: %s", ota_reply);
|
||||
Serial.print("OTA: aborted, resuming bridge - "); Serial.println(ota_reply);
|
||||
setBridgeState(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,11 @@ void setup() {
|
||||
store.save("_main", the_mesh.self_id);
|
||||
}
|
||||
|
||||
// Print the running firmware version at boot so it's visible after an OTA
|
||||
// reboot without having to issue `ver` manually.
|
||||
Serial.print("Firmware: "); Serial.print(FIRMWARE_VERSION);
|
||||
Serial.print(" (built "); Serial.print(FIRMWARE_BUILD_DATE); Serial.println(")");
|
||||
|
||||
Serial.print("Repeater ID: ");
|
||||
mesh::Utils::printHex(Serial, the_mesh.self_id.pub_key, PUB_KEY_SIZE); Serial.println();
|
||||
|
||||
|
||||
Reference in new issue
Block a user