Lines Matching refs:update_cmd
66 UPDATE_CMD update_cmd[] = { variable
105 int num = sizeof(update_cmd) / sizeof(UPDATE_CMD); in RK_ota_set_partition()
117 if ( update_cmd[i].need_update || is_sdboot || is_usbboot) { in RK_ota_set_partition()
118 update_cmd[i].need_update = false; in RK_ota_set_partition()
120 if (strcmp(rkimage_hdr.item[j].name, update_cmd[i].name) == 0) { in RK_ota_set_partition()
121 LOGI("found rkimage_hdr.item[%d].name = %s.\n", j, update_cmd[i].name); in RK_ota_set_partition()
123 update_cmd[i].offset = *((DWORD *)(&rkimage_hdr.item[j].file[51])); in RK_ota_set_partition()
124 update_cmd[i].offset <<= 32; in RK_ota_set_partition()
125 update_cmd[i].offset += rkimage_hdr.item[j].offset; in RK_ota_set_partition()
126 … LOGI("offset more than 4G, after adjusting is %lld.\n", update_cmd[i].offset); in RK_ota_set_partition()
128 update_cmd[i].offset = rkimage_hdr.item[j].offset; in RK_ota_set_partition()
132 update_cmd[i].size = *((DWORD *)(&rkimage_hdr.item[j].file[56])); in RK_ota_set_partition()
133 update_cmd[i].size <<= 32; in RK_ota_set_partition()
134 update_cmd[i].size += rkimage_hdr.item[j].size; in RK_ota_set_partition()
135 … LOGI("size more than 4G, after adjusting is %lld.\n", update_cmd[i].size); in RK_ota_set_partition()
137 update_cmd[i].size = rkimage_hdr.item[j].size; in RK_ota_set_partition()
141 … update_cmd[i].flash_offset = (long long)rkimage_hdr.item[j].flash_offset * SECTOR_SIZE; in RK_ota_set_partition()
143 update_cmd[i].need_update = true; in RK_ota_set_partition()
152 if (*update_cmd[i].dest_path && (update_cmd[i].need_update == false)) { in RK_ota_set_partition()
154 unsigned char len = strlen(update_cmd[i].name); in RK_ota_set_partition()
155 …if (update_cmd[i].name[len - 2] == '_' && (update_cmd[i].name[len - 1] == 'a' || update_cmd[i].nam… in RK_ota_set_partition()
157 char slot_find = (update_cmd[i].name[len - 1] == 'a') ? 'b' : 'a'; in RK_ota_set_partition()
159 update_cmd[i].name[len - 1] = slot_find; in RK_ota_set_partition()
161 if (strcmp(rkimage_hdr.item[j].name, update_cmd[i].name) == 0) { in RK_ota_set_partition()
162 … LOGI("again found rkimage_hdr.item[%d].name = %s.\n", j, update_cmd[i].name); in RK_ota_set_partition()
164 … update_cmd[i].offset = *((DWORD *)(&rkimage_hdr.item[j].file[51])); in RK_ota_set_partition()
165 update_cmd[i].offset <<= 32; in RK_ota_set_partition()
166 update_cmd[i].offset += rkimage_hdr.item[j].offset; in RK_ota_set_partition()
167 … LOGI("offset more than 4G, after adjusting is %lld.\n", update_cmd[i].offset); in RK_ota_set_partition()
169 update_cmd[i].offset = rkimage_hdr.item[j].offset; in RK_ota_set_partition()
173 … update_cmd[i].size = *((DWORD *)(&rkimage_hdr.item[j].file[56])); in RK_ota_set_partition()
174 update_cmd[i].size <<= 32; in RK_ota_set_partition()
175 update_cmd[i].size += rkimage_hdr.item[j].size; in RK_ota_set_partition()
176 … LOGI("size more than 4G, after adjusting is %lld.\n", update_cmd[i].size); in RK_ota_set_partition()
178 update_cmd[i].size = rkimage_hdr.item[j].size; in RK_ota_set_partition()
181 update_cmd[i].need_update = true; in RK_ota_set_partition()
199 …if ( (partition & 0x800000 || is_sdboot || is_usbboot || (strcmp(update_cmd[i].name, "parameter") … in RK_ota_set_partition()
200 LOGI("need update %s.\n", update_cmd[i].name); in RK_ota_set_partition()
201 update_cmd[i].need_update = true; in RK_ota_set_partition()
204 …memset(update_cmd[i].dest_path, 0, sizeof(update_cmd[i].dest_path) / sizeof(update_cmd[i].dest_pat… in RK_ota_set_partition()
205 if (strcmp(update_cmd[i].name, "parameter") == 0) { in RK_ota_set_partition()
206 sprintf(update_cmd[i].dest_path, "%s/gpt", _url_dir); in RK_ota_set_partition()
208 sprintf(update_cmd[i].dest_path, "%s/%s", _url_dir, update_cmd[i].name); in RK_ota_set_partition()
211 if (strcmp(update_cmd[i].name, "parameter") == 0) { in RK_ota_set_partition()
212 sprintf(update_cmd[i].dest_path, "/dev/block/by-name/gpt"); in RK_ota_set_partition()
215 … sprintf(update_cmd[i].dest_path, "/dev/block/by-name/%s", update_cmd[i].name); in RK_ota_set_partition()
217 if ( update_cmd[i].need_update && (mtd_scan_partitions() > 0) ) { in RK_ota_set_partition()
218 … const MtdPartition *mtdp = mtd_find_partition_by_name(update_cmd[i].name); in RK_ota_set_partition()
220 sprintf(update_cmd[i].dest_path, "/dev/mtd%d", mtdp->device_index); in RK_ota_set_partition()
221 … LOGI("need update %s ,.dest_path: %s.\n", update_cmd[i].name, update_cmd[i].dest_path); in RK_ota_set_partition()
224 … sprintf(update_cmd[i].dest_path, "/dev/block/by-name/%s", update_cmd[i].name); in RK_ota_set_partition()
340 int num = sizeof(update_cmd) / sizeof(UPDATE_CMD); in RK_ota_start()
343 if (update_cmd[i].need_update) { in RK_ota_start()
344 if (update_cmd[i].cmd != NULL) { in RK_ota_start()
345 LOGI("now write %s to %s.\n", update_cmd[i].name, update_cmd[i].dest_path); in RK_ota_start()
346 sprintf(prompt, "[%s] upgrade start...\n", update_cmd[i].name); in RK_ota_start()
349 ( (strcmp(update_cmd[i].name, "misc") == 0) || in RK_ota_start()
350 (strcmp(update_cmd[i].name, "parameter") == 0) )) { in RK_ota_start()
355 LOGI("update_cmd.flash_offset = %lld.\n", update_cmd[i].flash_offset); in RK_ota_start()
356 if (update_cmd[i].cmd(_url, (void*)(&update_cmd[i])) != 0) { in RK_ota_start()
357 LOGE("update %s error.\n", update_cmd[i].dest_path); in RK_ota_start()
358 sprintf(prompt, "[%s] upgrade fail\n", update_cmd[i].name); in RK_ota_start()
363 sprintf(prompt, "[%s] upgraede success!\n", update_cmd[i].name); in RK_ota_start()
367 if (ota_recovery_cmds(update_cmd[i].flash_offset, update_cmd[i].dest_path)) { in RK_ota_start()
375 if (ota_recovery_cmds(update_cmd[i].flash_offset, update_cmd[i].dest_path)) { in RK_ota_start()
384 …if (strcmp(update_cmd[i].name, "parameter") == 0 || strcmp(update_cmd[i].name, "bootloader") == 0)… in RK_ota_start()
389 if (!update_cmd[i].skip_verify && in RK_ota_start()
390 comparefile(update_cmd[i].dest_path, _url, in RK_ota_start()
391 update_cmd[i].flash_offset, in RK_ota_start()
392 update_cmd[i].offset, update_cmd[i].size)) { in RK_ota_start()
393 LOGI("check %s ok.\n", update_cmd[i].dest_path); in RK_ota_start()
394 } else if (!update_cmd[i].skip_verify) { in RK_ota_start()
395 LOGE("check %s failed.\n", update_cmd[i].dest_path); in RK_ota_start()
408 if ( (!update_cmd[i].need_update) || (update_cmd[i].cmd == NULL)) { in RK_ota_start()
411 unsigned char len = strlen(update_cmd[i].name); in RK_ota_start()
412 …if (update_cmd[i].name[len - 2] == '_' && (update_cmd[i].name[len - 1] == 'a' || update_cmd[i].nam… in RK_ota_start()
413 char slot_find = (update_cmd[i].name[len - 1] == 'a') ? 'b' : 'a'; in RK_ota_start()
417 memcpy(part_name, update_cmd[i].name, len); in RK_ota_start()
421 if ( (!update_cmd[k].need_update) || (update_cmd[k].cmd == NULL)) { in RK_ota_start()
424 if ( (strcmp(update_cmd[k].name, part_name) == 0) ) { in RK_ota_start()
432 … if (ota_recovery_cmds(param_item[j].offset * SECTOR_SIZE, update_cmd[i].dest_path)) { in RK_ota_start()