[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:
@@ -103,6 +103,7 @@ typedef struct _PB_Main {
|
||||
PB_Storage_BackupRestoreRequest storage_backup_restore_request;
|
||||
PB_System_PowerInfoRequest system_power_info_request;
|
||||
PB_System_PowerInfoResponse system_power_info_response;
|
||||
PB_System_UpdateResponse system_update_response;
|
||||
} content;
|
||||
} PB_Main;
|
||||
|
||||
@@ -171,6 +172,7 @@ extern "C" {
|
||||
#define PB_Main_storage_backup_restore_request_tag 43
|
||||
#define PB_Main_system_power_info_request_tag 44
|
||||
#define PB_Main_system_power_info_response_tag 45
|
||||
#define PB_Main_system_update_response_tag 46
|
||||
|
||||
/* Struct field encoding specification for nanopb */
|
||||
#define PB_Empty_FIELDLIST(X, a) \
|
||||
@@ -228,7 +230,8 @@ X(a, STATIC, ONEOF, MSG_W_CB, (content,system_update_request,content.system
|
||||
X(a, STATIC, ONEOF, MSG_W_CB, (content,storage_backup_create_request,content.storage_backup_create_request), 42) \
|
||||
X(a, STATIC, ONEOF, MSG_W_CB, (content,storage_backup_restore_request,content.storage_backup_restore_request), 43) \
|
||||
X(a, STATIC, ONEOF, MSG_W_CB, (content,system_power_info_request,content.system_power_info_request), 44) \
|
||||
X(a, STATIC, ONEOF, MSG_W_CB, (content,system_power_info_response,content.system_power_info_response), 45)
|
||||
X(a, STATIC, ONEOF, MSG_W_CB, (content,system_power_info_response,content.system_power_info_response), 45) \
|
||||
X(a, STATIC, ONEOF, MSG_W_CB, (content,system_update_response,content.system_update_response), 46)
|
||||
#define PB_Main_CALLBACK NULL
|
||||
#define PB_Main_DEFAULT NULL
|
||||
#define PB_Main_content_empty_MSGTYPE PB_Empty
|
||||
@@ -273,6 +276,7 @@ X(a, STATIC, ONEOF, MSG_W_CB, (content,system_power_info_response,content.s
|
||||
#define PB_Main_content_storage_backup_restore_request_MSGTYPE PB_Storage_BackupRestoreRequest
|
||||
#define PB_Main_content_system_power_info_request_MSGTYPE PB_System_PowerInfoRequest
|
||||
#define PB_Main_content_system_power_info_response_MSGTYPE PB_System_PowerInfoResponse
|
||||
#define PB_Main_content_system_update_response_MSGTYPE PB_System_UpdateResponse
|
||||
|
||||
extern const pb_msgdesc_t PB_Empty_msg;
|
||||
extern const pb_msgdesc_t PB_StopSession_msg;
|
||||
|
@@ -1,3 +1,3 @@
|
||||
#pragma once
|
||||
#define PROTOBUF_MAJOR_VERSION 0
|
||||
#define PROTOBUF_MINOR_VERSION 6
|
||||
#define PROTOBUF_MINOR_VERSION 7
|
||||
|
@@ -48,6 +48,9 @@ PB_BIND(PB_System_ProtobufVersionResponse, PB_System_ProtobufVersionResponse, AU
|
||||
PB_BIND(PB_System_UpdateRequest, PB_System_UpdateRequest, AUTO)
|
||||
|
||||
|
||||
PB_BIND(PB_System_UpdateResponse, PB_System_UpdateResponse, AUTO)
|
||||
|
||||
|
||||
PB_BIND(PB_System_PowerInfoRequest, PB_System_PowerInfoRequest, AUTO)
|
||||
|
||||
|
||||
@@ -56,3 +59,4 @@ PB_BIND(PB_System_PowerInfoResponse, PB_System_PowerInfoResponse, AUTO)
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -16,6 +16,17 @@ typedef enum _PB_System_RebootRequest_RebootMode {
|
||||
PB_System_RebootRequest_RebootMode_UPDATE = 2
|
||||
} PB_System_RebootRequest_RebootMode;
|
||||
|
||||
typedef enum _PB_System_UpdateResponse_UpdateResultCode {
|
||||
PB_System_UpdateResponse_UpdateResultCode_OK = 0,
|
||||
PB_System_UpdateResponse_UpdateResultCode_ManifestPathInvalid = 1,
|
||||
PB_System_UpdateResponse_UpdateResultCode_ManifestFolderNotFound = 2,
|
||||
PB_System_UpdateResponse_UpdateResultCode_ManifestInvalid = 3,
|
||||
PB_System_UpdateResponse_UpdateResultCode_StageMissing = 4,
|
||||
PB_System_UpdateResponse_UpdateResultCode_StageIntegrityError = 5,
|
||||
PB_System_UpdateResponse_UpdateResultCode_ManifestPointerError = 6,
|
||||
PB_System_UpdateResponse_UpdateResultCode_TargetMismatch = 7
|
||||
} PB_System_UpdateResponse_UpdateResultCode;
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _PB_System_DeviceInfoRequest {
|
||||
char dummy_field;
|
||||
@@ -84,6 +95,10 @@ typedef struct _PB_System_RebootRequest {
|
||||
PB_System_RebootRequest_RebootMode mode;
|
||||
} PB_System_RebootRequest;
|
||||
|
||||
typedef struct _PB_System_UpdateResponse {
|
||||
PB_System_UpdateResponse_UpdateResultCode code;
|
||||
} PB_System_UpdateResponse;
|
||||
|
||||
typedef struct _PB_System_GetDateTimeResponse {
|
||||
bool has_datetime;
|
||||
PB_System_DateTime datetime;
|
||||
@@ -100,6 +115,10 @@ typedef struct _PB_System_SetDateTimeRequest {
|
||||
#define _PB_System_RebootRequest_RebootMode_MAX PB_System_RebootRequest_RebootMode_UPDATE
|
||||
#define _PB_System_RebootRequest_RebootMode_ARRAYSIZE ((PB_System_RebootRequest_RebootMode)(PB_System_RebootRequest_RebootMode_UPDATE+1))
|
||||
|
||||
#define _PB_System_UpdateResponse_UpdateResultCode_MIN PB_System_UpdateResponse_UpdateResultCode_OK
|
||||
#define _PB_System_UpdateResponse_UpdateResultCode_MAX PB_System_UpdateResponse_UpdateResultCode_TargetMismatch
|
||||
#define _PB_System_UpdateResponse_UpdateResultCode_ARRAYSIZE ((PB_System_UpdateResponse_UpdateResultCode)(PB_System_UpdateResponse_UpdateResultCode_TargetMismatch+1))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -120,6 +139,7 @@ extern "C" {
|
||||
#define PB_System_ProtobufVersionRequest_init_default {0}
|
||||
#define PB_System_ProtobufVersionResponse_init_default {0, 0}
|
||||
#define PB_System_UpdateRequest_init_default {NULL}
|
||||
#define PB_System_UpdateResponse_init_default {_PB_System_UpdateResponse_UpdateResultCode_MIN}
|
||||
#define PB_System_PowerInfoRequest_init_default {0}
|
||||
#define PB_System_PowerInfoResponse_init_default {NULL, NULL}
|
||||
#define PB_System_PingRequest_init_zero {NULL}
|
||||
@@ -136,6 +156,7 @@ extern "C" {
|
||||
#define PB_System_ProtobufVersionRequest_init_zero {0}
|
||||
#define PB_System_ProtobufVersionResponse_init_zero {0, 0}
|
||||
#define PB_System_UpdateRequest_init_zero {NULL}
|
||||
#define PB_System_UpdateResponse_init_zero {_PB_System_UpdateResponse_UpdateResultCode_MIN}
|
||||
#define PB_System_PowerInfoRequest_init_zero {0}
|
||||
#define PB_System_PowerInfoResponse_init_zero {NULL, NULL}
|
||||
|
||||
@@ -157,6 +178,7 @@ extern "C" {
|
||||
#define PB_System_ProtobufVersionResponse_major_tag 1
|
||||
#define PB_System_ProtobufVersionResponse_minor_tag 2
|
||||
#define PB_System_RebootRequest_mode_tag 1
|
||||
#define PB_System_UpdateResponse_code_tag 1
|
||||
#define PB_System_GetDateTimeResponse_datetime_tag 1
|
||||
#define PB_System_SetDateTimeRequest_datetime_tag 1
|
||||
|
||||
@@ -241,6 +263,11 @@ X(a, POINTER, SINGULAR, STRING, update_manifest, 1)
|
||||
#define PB_System_UpdateRequest_CALLBACK NULL
|
||||
#define PB_System_UpdateRequest_DEFAULT NULL
|
||||
|
||||
#define PB_System_UpdateResponse_FIELDLIST(X, a) \
|
||||
X(a, STATIC, SINGULAR, UENUM, code, 1)
|
||||
#define PB_System_UpdateResponse_CALLBACK NULL
|
||||
#define PB_System_UpdateResponse_DEFAULT NULL
|
||||
|
||||
#define PB_System_PowerInfoRequest_FIELDLIST(X, a) \
|
||||
|
||||
#define PB_System_PowerInfoRequest_CALLBACK NULL
|
||||
@@ -266,6 +293,7 @@ extern const pb_msgdesc_t PB_System_PlayAudiovisualAlertRequest_msg;
|
||||
extern const pb_msgdesc_t PB_System_ProtobufVersionRequest_msg;
|
||||
extern const pb_msgdesc_t PB_System_ProtobufVersionResponse_msg;
|
||||
extern const pb_msgdesc_t PB_System_UpdateRequest_msg;
|
||||
extern const pb_msgdesc_t PB_System_UpdateResponse_msg;
|
||||
extern const pb_msgdesc_t PB_System_PowerInfoRequest_msg;
|
||||
extern const pb_msgdesc_t PB_System_PowerInfoResponse_msg;
|
||||
|
||||
@@ -284,6 +312,7 @@ extern const pb_msgdesc_t PB_System_PowerInfoResponse_msg;
|
||||
#define PB_System_ProtobufVersionRequest_fields &PB_System_ProtobufVersionRequest_msg
|
||||
#define PB_System_ProtobufVersionResponse_fields &PB_System_ProtobufVersionResponse_msg
|
||||
#define PB_System_UpdateRequest_fields &PB_System_UpdateRequest_msg
|
||||
#define PB_System_UpdateResponse_fields &PB_System_UpdateResponse_msg
|
||||
#define PB_System_PowerInfoRequest_fields &PB_System_PowerInfoRequest_msg
|
||||
#define PB_System_PowerInfoResponse_fields &PB_System_PowerInfoResponse_msg
|
||||
|
||||
@@ -304,6 +333,7 @@ extern const pb_msgdesc_t PB_System_PowerInfoResponse_msg;
|
||||
#define PB_System_ProtobufVersionResponse_size 12
|
||||
#define PB_System_RebootRequest_size 2
|
||||
#define PB_System_SetDateTimeRequest_size 24
|
||||
#define PB_System_UpdateResponse_size 2
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
|
Reference in New Issue
Block a user