fs_mgr_avb: refactors how vbmeta is loaded
Adds two classes FsManagerAvbhandle and FsManagerAvbVerifier to replace the following functions or struct: - fs_mgr_load_vbmeta_images() -> FsManagerAvbhandle::Open() - fs_mgr_unload_vbmeta_images() -> deleted - fs_mgr_setup_avb() -> FsManagerAvbhandle::SetUpAvb() - androidboot_vbmeta -> FsManagerAvbVerifier - load_vbmeta_prop() -> FsManagerAvbVerifier::Create() - verify_vbmeta_images() -> FsManagerAvbVerifier::VerifyVbmetaImages() And only invokes FsManagerAvbhandle::Open() when there is a fstab entry having 'avb' flag (need HASHTREE descriptor). fs_mgr_is_avb_used() can be removed as it only checks system property "ro.boot.vbmeta.hash_alg" to decide whether vbmeta needs to be loaded, which might not be accurate. For example, there are only HASH descriptors in the verified chain but no HASHTREE descriptors. In this case, the fs_mgr doesn't have to do anything because it only takes care of HASHTREE descriptors. Also adds a new class FsManagerAvbOps to provide the C++ binding FsManagerAvbOps::AvbSlotVerify() for libavb->avb_slot_verify(). Bug: 33254008 Test: test AVB on bullhead Change-Id: I8fe15ba01c277152630a2a5c1c5c7f25fbf34030
Loading
Please register or sign in to comment