I’m using Yocto SUMO version meta-mender for our FOTA update.
We are performing negative scenario where we are performing abrupt power off of the device during OS fota installation still in progress. After device boot up we observed that mender_boot_part, mender_boot_part_hex variables updated to boot from next partition. But the new partition contents were not completely written by mender as there was abrupt power off during the installation was in progress.
But question is why was the mender_boot_part, mender_boot_part_hex variables updated here though the new partition was not completed written. Please assist. Thanks
We have identified one bug in our sync code, which I have posted here. However, hitting this bug is quite rare. Could you post me the line from your client log which contains “Native sector size of block device”?
Hello @kacf ,
Below is the log snippet of the client which contains “Native sector size”
INFO native sector size of block device /dev/mmcblk0p3 is 512, we will write in chunks of 1048576 module=dual_rootfs_device
Now coming the scenario:
We have powered off abruptly during the mender installation phase. So the installation could be for example 20% complete or 60% complete. And it may not be at the very end of mender installation. Since installation is partially complete, we cannot boot from the new partition as kernel or rootfs packages may not be present.
So question is:
Would the mender_boot_part, mender_boot_part_hex be updated to boot from new partition, if abruptly powered off during completion of only 60% or 20% (mender installation)?
Thanks for the log output, it’s pretty unlikely you are affected by the mentioned bug then.
Mender does not change mender_boot_part and mender_boot_part_hex until all of the download is both finished and synced to disk. Is it possible you have any state scripts, either in /etc/mender/scripts, or attached to the artifact, which could change the variables?
As you can see, the only scenario where the environment is switched to what you have in your log, is when Mender has successfully run from the new partition. Bootloader environment updates are atomic and checksummed, so I don’t think partial updates can explain this. This leads me to believe there is something wrong in the bootloader setup itself, but it’s difficult to be specific. You might want to inspect the environment at various points to make sure it is as expected.