mirror of
https://dev.iopsys.eu/system/sysmngr.git
synced 2026-01-27 18:47:19 +01:00
Fail upgrade on active bank
This commit is contained in:
parent
60bc2108b5
commit
257c9fac69
1 changed files with 10 additions and 2 deletions
|
|
@ -280,6 +280,15 @@ static int bbf_fw_image_download(struct ubus_context *ctx, struct fw_download_da
|
|||
char fault_msg[128] = {0};
|
||||
time_t complete_time = 0;
|
||||
time_t start_time = time(NULL);
|
||||
char *active_bank_id = NULL;
|
||||
|
||||
// Check if trying to download in active bank
|
||||
active_bank_id = get_fwbank_bank_id("active");
|
||||
if (DM_STRCMP(dw_data->bank_id, active_bank_id) == 0 ) {
|
||||
res = -1;
|
||||
snprintf(fault_msg, sizeof(fault_msg), "Trying to download in active bank %s", active_bank_id);
|
||||
goto end;
|
||||
}
|
||||
|
||||
DM_STRNCPY(fw_image_path, "/tmp/firmware-XXXXXX", sizeof(fw_image_path));
|
||||
|
||||
|
|
@ -661,8 +670,7 @@ static int operate_DeviceInfoFirmwareImage_Download(char *refparam, struct dmctx
|
|||
dw_data.obj_path = dmstrdup(obj_path);
|
||||
|
||||
int res = bbf_fw_image_download(ctx->ubus_ctx, &dw_data);
|
||||
|
||||
if (res == 1) {
|
||||
if (res != 0) {
|
||||
bbfdm_set_fault_message(ctx, "Firmware validation failed");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue