Home | History | Annotate | Download | only in fs_mgr

Lines Matching refs:fstab

574 static int compare_last_signature(struct fstab_rec *fstab, int *match)
587 if (fec_open(&f, fstab->blk_device, O_RDONLY, FEC_VERITY_DISABLE,
589 PERROR << "Failed to open '" << fstab->blk_device << "'";
595 PERROR << "Failed to get verity metadata '" << fstab->blk_device << "'";
602 basename(fstab->mount_point)) >= (int)sizeof(tag)) {
603 LERROR << "Metadata tag name too long for " << fstab->mount_point;
607 if (metadata_find(fstab->verity_loc, tag, SHA256_DIGEST_LENGTH,
612 fd = TEMP_FAILURE_RETRY(open(fstab->verity_loc, O_RDWR | O_SYNC | O_CLOEXEC));
615 PERROR << "Failed to open " << fstab->verity_loc;
622 << fstab->verity_loc << " offset " << offset;
633 << fstab->verity_loc << " offset " << offset;
645 fstab, off64_t *offset)
650 basename(fstab->mount_point)) >= (int)sizeof(tag)) {
651 LERROR << "Metadata tag name too long for " << fstab->mount_point;
655 return metadata_find(fstab->verity_loc, tag, sizeof(struct verity_state),
659 int load_verity_state(struct fstab_rec* fstab, int* mode) {
675 if (get_verity_state_offset(fstab, &offset) < 0) {
683 return write_verity_state(fstab->verity_loc, offset, *mode);
686 if (!compare_last_signature(fstab, &match) && !match) {
689 return write_verity_state(fstab->verity_loc, offset, *mode);
692 return read_verity_state(fstab->verity_loc, offset, mode);
751 // prepares the verity enabled (MF_VERIFY / MF_VERIFYATBOOT) fstab record for
754 int fs_mgr_setup_verity(struct fstab_rec *fstab, bool wait_for_verity_dev)
765 const std::string mount_point(basename(fstab->mount_point));
768 if (fec_open(&f, fstab->blk_device, O_RDONLY, FEC_VERITY_DISABLE,
770 PERROR << "Failed to open '" << fstab->blk_device << "'";
776 PERROR << "Failed to get verity metadata '" << fstab->blk_device << "'";
798 params.ecc_dev = fstab->blk_device;
818 if (load_verity_state(fstab, &params.mode) < 0) {
859 update_verity_table_blk_device(fstab->blk_device, &params.table,
860 fstab->fs_mgr_flags & MF_SLOTSELECT);
907 fs_mgr_set_blk_ro(fstab->blk_device);
911 if (fstab->fs_mgr_flags & MF_VERIFYATBOOT) {
912 LINFO << "Verifying partition " << fstab->blk_device << " at boot";
916 << fstab->blk_device << " at boot";
923 free(fstab->blk_device);
924 fstab->blk_device = strdup(verity_blk_name.c_str());
931 if (wait_for_verity_dev && !fs_mgr_wait_for_file(fstab->blk_device, 1s)) {