#define SYSTEM_LOG_DIR "/opt/var/log"
int ua_op_mode = UA_OP_MODE_FG;
+int dm_verity_status = DM_VERITY_DISABLED;
static char fota_result[MAX_FILE_PATH];
static char fota_cause[MAX_FILE_PATH];
percent = percent / 5;
} else if ((ua_data->ua_operation == UI_OP_SCOUT_UPDATE)
|| (ua_data->ua_operation == UI_OP_UPDATE)) {
- percent = 20 + percent * 4 / 5;
+ if (dm_verity_status == DM_VERITY_ENABLED)
+ percent = 20 + percent * 3 / 5; /* 20 ~ 80 */
+ else
+ percent = 20 + percent * 4 / 5; /* 20 ~ 100 */
}
if (ua_op_mode == UA_OP_MODE_FG)
}
/*-----------------------------------------------------------------------------
+ check_dm_verity_status
+ ----------------------------------------------------------------------------*/
+int check_dm_verity_status(void)
+{
+ int ret = 0;
+
+ ret = access("/usr/bin/verityctl", F_OK);
+ if (ret == -1) {
+ if (errno == ENOENT) {
+ LOG("dm-verity status : disabled\n");
+ dm_verity_status = DM_VERITY_DISABLED;
+ return 0;
+ } else {
+ LOG("access failed with errno: %d\n", errno);
+ return -errno;
+ }
+ }
+
+ LOG("dm-verity status : enabled\n");
+ dm_verity_status = DM_VERITY_ENABLED;
+ return 0;
+}
+
+/*-----------------------------------------------------------------------------
remove_temp_files
----------------------------------------------------------------------------*/
void remove_temp_files(void)
log_init();
fota_cfg_str_load();
+ if (check_dm_verity_status() < 0) {
+ LOG("check_dm_verity_status fail\n");
+ ret = UPI_CONFIG_ERROR;
+ goto Results;
+ }
+
/* Check fota folder path */
if (check_existence(delta_folder) == 0) {
ret = UPI_DELTA_PATH_ERROR;