[FL-2578] Updater fixes related to /int handling (#1359)
* Updater fixes related to /int handling updater: performing factory reset on update, checking for LFS free space before updating, fixed improper error handling on backup/restore operations, rebalanced update stage weights for better progress visuals scripts: added CLI output validation for selfupdate.py storage: added pointer validation in storage_int_common_fs_info desktop: fixed crash on rendering invalid slideshows * Typo fix * rpc: Updated protobuf to 0.9 * rpc: removed updater status conversion Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -67,7 +67,6 @@ static bool update_task_post_update(UpdateTask* update_task) {
|
||||
string_get_cstr(update_task->update_path), LFS_BACKUP_DEFAULT_FILENAME, file_path);
|
||||
|
||||
update_task_set_progress(update_task, UpdateTaskStageLfsRestore, 0);
|
||||
update_operation_disarm();
|
||||
|
||||
CHECK_RESULT(lfs_backup_unpack(update_task->storage, string_get_cstr(file_path)));
|
||||
|
||||
@@ -117,28 +116,32 @@ static bool update_task_post_update(UpdateTask* update_task) {
|
||||
int32_t update_task_worker_backup_restore(void* context) {
|
||||
furi_assert(context);
|
||||
UpdateTask* update_task = context;
|
||||
bool success = false;
|
||||
|
||||
FuriHalRtcBootMode boot_mode = furi_hal_rtc_get_boot_mode();
|
||||
FuriHalRtcBootMode boot_mode = update_task->boot_mode;
|
||||
if((boot_mode != FuriHalRtcBootModePreUpdate) && (boot_mode != FuriHalRtcBootModePostUpdate)) {
|
||||
/* no idea how we got here. Clear to normal boot */
|
||||
update_operation_disarm();
|
||||
/* no idea how we got here. Do nothing */
|
||||
return UPDATE_TASK_NOERR;
|
||||
}
|
||||
|
||||
if(!update_task_parse_manifest(update_task)) {
|
||||
return UPDATE_TASK_FAILED;
|
||||
}
|
||||
bool success = false;
|
||||
do {
|
||||
if(!update_task_parse_manifest(update_task)) {
|
||||
break;
|
||||
}
|
||||
|
||||
/* Waiting for BT service to 'start', so we don't race for boot mode flag */
|
||||
furi_record_open("bt");
|
||||
furi_record_close("bt");
|
||||
/* Waiting for BT service to 'start', so we don't race for boot mode flag */
|
||||
furi_record_open("bt");
|
||||
furi_record_close("bt");
|
||||
|
||||
if(boot_mode == FuriHalRtcBootModePreUpdate) {
|
||||
success = update_task_pre_update(update_task);
|
||||
} else if(boot_mode == FuriHalRtcBootModePostUpdate) {
|
||||
success = update_task_post_update(update_task);
|
||||
}
|
||||
if(boot_mode == FuriHalRtcBootModePreUpdate) {
|
||||
success = update_task_pre_update(update_task);
|
||||
} else if(boot_mode == FuriHalRtcBootModePostUpdate) {
|
||||
success = update_task_post_update(update_task);
|
||||
if(success) {
|
||||
update_operation_disarm();
|
||||
}
|
||||
}
|
||||
} while(false);
|
||||
|
||||
if(!success) {
|
||||
update_task_set_progress(update_task, UpdateTaskStageError, 0);
|
||||
|
||||
Reference in New Issue
Block a user