Function sync
pub fn sync(archive: &Path) -> Result<()>Expand description
Copies the updated partitions to the inactive slot after the reboot.
Call it after run and a reboot into the updated slot. It first checks
the active partitions against the checksums in the FOTA blob. This fails
if the bootloader fell back to the old slot. It skips the check for a UBI
image that a full update wrote to a raw partition, because UBI changes the
image once it attaches it.
It also checks the images of full updates in the FOTA blob. Then it copies a diff update from the active partition and writes a full update from the FOTA blob to the inactive slot. It reads the written data back and checks it against the same checksums.
ยงErrors
Returns an error if the blob or its config is invalid, if a partition is missing or has the wrong checksum, if flashing fails, or on any IO error.