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[0000] 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?
Ok, then I will need more information, since I can’t immediately see what would cause the problem.
Tell me more about your setup:
Are you using Mender in daemon mode or standalone mode?
Can you post the following information:
The output from this command, before you start the update:
grub-mender-grubenv-print || fw_printenv; mount
The commands you use to invoke the update, or the steps in the UI, if that’s what you use.
After the deployment, the output from the same command again:
grub-mender-grubenv-print || fw_printenv; mount
Can you post the deployment log? In standalone mode, this is just the output from the command. In daemon mode, the log can be found at /var/lib/mender/deployments.0000.<UID>.
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.