ANDROID: AVB error handler to invalidate vbmeta partition.
If androidboot.vbmeta.invalidate_on_error is 'yes' and
androidboot.vbmeta.device is set and points to a device with vbmeta
magic, this header will be overwritten upon an irrecoverable dm-verity
error. The side-effect of this is that the slot will fail to verify on
next reboot, effectively triggering the boot loader to fallback to
another slot. This work both if the vbmeta struct is at the start of a
partition or if there's an AVB footer at the end.
This code is based on drivers/md/dm-verity-chromeos.c from ChromiumOS.
Signed-off-by: David Zeuthen <zeuthen@google.com>
(cherry picked from commit
9dc978d43ec78fb3d5126c1155369bd70d29fc96)
Bug
200437731
Change-Id: I2a8b155007a82ef70891584d031494895c7fa112
Reviewed-on: https://git-master.nvidia.com/r/
1925339
GVS: Gerrit_Virtual_Submit
Reviewed-by: Gerber Huang <gerberh@nvidia.com>
Tested-by: Gerber Huang <gerberh@nvidia.com>
Reviewed-by: Yijun Zhou <yijunz@nvidia.com>
Reviewed-by: Ian Chang <ianc@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>