From acbf9bef43bc650ed84ba891183ebdf689dafb64 Mon Sep 17 00:00:00 2001 From: Sami Tolvanen Date: Thu, 19 Mar 2015 10:00:34 +0000 Subject: Add init command to set verified properties Add a command that updates dm-verity state and sets partition.%.verified properties used by adb remount. This is needed in init since fs_mgr cannot set properties: I6a28cccb1ccce960841af20a4b20c32d424b5524 Change-Id: I0fdf5bc29c56690dcadff9d0eb216d3c68483538 --- fs_mgr/include/fs_mgr.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'fs_mgr/include') diff --git a/fs_mgr/include/fs_mgr.h b/fs_mgr/include/fs_mgr.h index 0437d45..d2c8fff 100644 --- a/fs_mgr/include/fs_mgr.h +++ b/fs_mgr/include/fs_mgr.h @@ -27,6 +27,10 @@ // turn verity off in userdebug builds. #define VERITY_METADATA_MAGIC_DISABLE 0x46464f56 // "VOFF" +#ifdef __cplusplus +extern "C" { +#endif + // Verity modes enum verity_mode { VERITY_MODE_EIO = 0, @@ -35,10 +39,6 @@ enum verity_mode { VERITY_MODE_LAST = VERITY_MODE_RESTART }; -#ifdef __cplusplus -extern "C" { -#endif - /* * The entries must be kept in the same order as they were seen in the fstab. * Unless explicitly requested, a lookup on mount point should always @@ -66,6 +66,10 @@ struct fstab_rec { unsigned int zram_size; }; +// Callback function for verity status +typedef void (*fs_mgr_verity_state_callback)(struct fstab_rec *fstab, + const char *mount_point, int status); + struct fstab *fs_mgr_read_fstab(const char *fstab_path); void fs_mgr_free_fstab(struct fstab *fstab); @@ -84,7 +88,7 @@ int fs_mgr_unmount_all(struct fstab *fstab); int fs_mgr_get_crypt_info(struct fstab *fstab, char *key_loc, char *real_blk_device, int size); int fs_mgr_load_verity_state(int *mode); -int fs_mgr_update_verity_state(); +int fs_mgr_update_verity_state(fs_mgr_verity_state_callback callback); int fs_mgr_add_entry(struct fstab *fstab, const char *mount_point, const char *fs_type, const char *blk_device); -- cgit v1.1