Skip to content

Commit fff2d10

Browse files
authored
RDKB-60656 : Available memory check for firmware downloads (#13)
RDKB-60656 : Available memory check for firmware downloads Reason for change: Before firmware download, we need to check if the device have enough memory Test Procedure: 1. while firmware download, available memory check logs should be seen. 2. If available memory < required memory, firmware download should not start. Risks: medium Priority: P1 **Gerrit meta-layer changes:** https://gerrit.teamccp.com/#/q/topic:RDKB-60656+(status:open+OR+status:merged) **List all dependent GitHub PRs:** rdkcentral/provisioning-and-management#178 rdkcentral/utopia#182 rdkcentral/cable-modem-agent#23 rdkcentral/miscellaneous-broadband#37 https://github.com/rdk-gdcs/apparmor-profiles/pull/49
1 parent fa73516 commit fff2d10

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

source/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ bin_PROGRAMS = XconfHttpDl
2121
AM_CPPFLAGS = -I$(top_srcdir)/hal/include
2222
AM_CFLAGS = $(AM_CPPFLAGS)
2323
AM_LDFLAGS = -lccsp_common
24-
AM_LDFLAGS += -lcm_mgnt -lsysevent -lsyscfg
24+
AM_LDFLAGS += -lcm_mgnt -lsysevent -lsyscfg -lfw_download_chk
2525
XconfHttpDl_SOURCES = cm_http_dl.c
2626

source/cm_http_dl.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <string.h>
2222

2323
#include <telemetry_busmessage_sender.h>
24+
#include "fw_download_check.h"
2425
#include <syscfg/syscfg.h>
2526

2627
#include "cm_hal.h"
@@ -636,8 +637,12 @@ int main(int argc,char *argv[])
636637
}
637638
else if (type == HTTP_DOWNLOAD)
638639
{
639-
http_status = HTTP_Download();
640-
640+
if(can_proceed_fw_download() == FW_DWNLD_MEMCHK_NOT_ENOUGH_MEM){
641+
printf("Available memory is not enough to proceed with firmware download\n");
642+
}else{
643+
http_status = HTTP_Download();
644+
}
645+
641646
// The return code is after RETRY_HTTP_DOWNLOAD_LIMIT has been reached
642647
// For 200, return SUCCESS, else FAILURE and retry in the next window
643648
if(http_status == 200)

0 commit comments

Comments
 (0)