[FL-2527] Updater: Migrating to new manifest path convention (#1213)
* Updater: Migrating to new manifest path convention * RPC: Added update preparation status to RPC * RPC: bumped protobuf submodule * Bumped protobuf_version.h * FuriCore: add missing include. Lib: make mlib smaller * Explicitly tell where we have doubles and fix random in animations * makefile: added -DLFS_NO_DEBUG * Updater: path len constant dedup * Updater: checking for hardware version match before parsing manifest * LD: moved _DRIVER_CONTEXT sections to .bss, where they belong. * LD: avoiding PROBGITS warning, moved _CONTEXT to data * Updater: Added version check on update package - refusing to install outdated Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -275,15 +275,22 @@ static void rpc_system_system_update_request_process(const PB_Main* request, voi
|
||||
RpcSession* session = (RpcSession*)context;
|
||||
furi_assert(session);
|
||||
|
||||
bool update_prepare_result =
|
||||
update_operation_prepare(request->content.system_update_request.update_manifest) ==
|
||||
UpdatePrepareResultOK;
|
||||
UpdatePrepareResult update_prepare_result =
|
||||
update_operation_prepare(request->content.system_update_request.update_manifest);
|
||||
/* RPC enum does not have such entry; setting to closest one */
|
||||
if(update_prepare_result == UpdatePrepareResultOutdatedManifestVersion) {
|
||||
update_prepare_result = UpdatePrepareResultManifestInvalid;
|
||||
}
|
||||
|
||||
PB_Main* response = malloc(sizeof(PB_Main));
|
||||
response->command_id = request->command_id;
|
||||
response->has_next = false;
|
||||
response->command_status = update_prepare_result ? PB_CommandStatus_OK :
|
||||
PB_CommandStatus_ERROR_INVALID_PARAMETERS;
|
||||
response->command_status = (update_prepare_result == UpdatePrepareResultOK) ?
|
||||
PB_CommandStatus_OK :
|
||||
PB_CommandStatus_ERROR_INVALID_PARAMETERS;
|
||||
response->which_content = PB_Main_system_update_response_tag;
|
||||
response->content.system_update_response.code =
|
||||
(PB_System_UpdateResponse_UpdateResultCode)update_prepare_result;
|
||||
rpc_send_and_release(session, response);
|
||||
free(response);
|
||||
}
|
||||
|
Reference in New Issue
Block a user