1.修复升级无法重置参数问题

This commit is contained in:
payton 2023-12-29 21:29:06 +08:00
parent f47a6c0b0b
commit eccfb003fb

View File

@ -155,7 +155,7 @@ static int nvt_handle_fw_abin(void)
{ {
int ret = 0; int ret = 0;
char cmdline[1024] = {0}; char cmdline[1024] = {0};
char buf[1024] = {0}; char buf[512] = {0};
int ota_upgrade_sts = 0; int ota_upgrade_sts = 0;
int is_ota = 0; int is_ota = 0;
if(WDT_OTA_GET_STS() == WDT_OTA_MAKEFOURCC(WDT_OTA_STS_LOADER_DETECTING_FW)) if(WDT_OTA_GET_STS() == WDT_OTA_MAKEFOURCC(WDT_OTA_STS_LOADER_DETECTING_FW))
@ -216,21 +216,27 @@ static int nvt_handle_fw_abin(void)
} }
} else{ } else{
printf("%s%s:%d Update successfully %s\r\n", ANSI_COLOR_YELLOW, __FUNCTION__, __LINE__, ANSI_COLOR_RESET); printf("%s%s:%d Update successfully %s\r\n", ANSI_COLOR_YELLOW, __FUNCTION__, __LINE__, ANSI_COLOR_RESET);
ota_upgrade_sts = 1;
if(is_ota) if(is_ota)
WDT_OTA_SET_STS(WDT_OTA_STS_UBOOT_UPDATE_OK); WDT_OTA_SET_STS(WDT_OTA_STS_UBOOT_UPDATE_OK);
ota_upgrade_sts = 1;
} }
/* /*
* To handle bootargs expanding for the kernel /proc/cmdline and uboot mtdids env setting * To handle bootargs expanding for the kernel /proc/cmdline and uboot mtdids env setting
*/ */
sprintf(buf,"%s ",env_get("bootargs")); //printf("%s:%d ota_upgrade_sts:%d\n", __FUNCTION__, __LINE__ ,ota_upgrade_sts);
snprintf(buf, sizeof(buf), env_get("bootargs"));
//sprintf(buf,"%s ",env_get("bootargs"));
//printf("%s:%d ota_upgrade_sts:%d\n", __FUNCTION__, __LINE__ ,ota_upgrade_sts);
strcat(cmdline, buf); strcat(cmdline, buf);
ret = nvt_part_config((char *)cmdline, NULL); ret = nvt_part_config((char *)cmdline, NULL);
if (ret < 0) if (ret < 0)
return ret; return ret;
if (ota_upgrade_sts == 1) { if (ota_upgrade_sts != 0) {
strcat(cmdline, "ota_flag=0x1"); strcat(cmdline, "ota_flag=0x1");
} }