[Bufgix][API-1207][FOTA]delete check partition_nand in fota and upgrade cpu core check
Only Configure: No
Affected branch: GSW3.0-No-Connman
Affected module: fota
Is it addected on both ZXIC and MTK: only MTK
Self-test: Yes
Doc Update: No
Change-Id: I1f2c2c58d391ae44c40f341eebba9b93000fa306
diff --git a/src/lynq/lib/liblynq-fota/rock_ua/rock_ua.c b/src/lynq/lib/liblynq-fota/rock_ua/rock_ua.c
index d14574e..c5ce63f 100755
--- a/src/lynq/lib/liblynq-fota/rock_ua/rock_ua.c
+++ b/src/lynq/lib/liblynq-fota/rock_ua/rock_ua.c
@@ -160,7 +160,6 @@
static unsigned int now_patch = 0;
unsigned int current_slot = 0;
unsigned char rock_debug_buffer[512];
-char partition_addr[64] = {0};
@@ -449,11 +448,7 @@
RLOGD("+[UA]: Error opening metadata file: %s\n",strerror(errno));
return -err;
}
- strcpy(partition_addr, lynq_fota_addr);
- n = strlen(lynq_fota_addr) - strlen(fota_name);
- memset(partition_addr +n, 0, sizeof(partition_addr) -n);
- strcat(partition_addr, "partition_nand.xml");
- RLOGD("get partition addr :%s\n", partition_addr);
+
fd_update_status = open(FILE_UPDATE_STATE,O_RDWR | O_CREAT,0777);
if (fd_update_status < 0) {
@@ -633,8 +628,7 @@
int ret;
char buffer[3][64];
FILE *fp;
- int num;
- char num_char[2];
+ char num;
fp = popen("od -x /proc/device-tree/chosen/atag,devinfo","r");
for(i=0;i<3;i++)
@@ -648,17 +642,16 @@
}
RLOGD("%c\n", buffer[2][14]);
- num_char[0] = buffer[2][14];
- RLOGD("num_char=%s\n",num_char);
- num = atoi(num_char);
+ num = buffer[2][14];
- RLOGD("num=%d\n", num);
- if(num == 0 || num ==1)
+
+ RLOGD("num=%c\n", num);
+ if(num == '0' || num == '1')
{
printf("this is four core\n");
return 4;
}
- else if(num == 2 || num == 3)
+ else if(num == '2' || num == '3')
{
printf("this is two core\n");
return 2;
@@ -674,22 +667,6 @@
}
-int check_partition()
-{
- int ret;
- char buf[128];
- sprintf(buf,"grep \"bl2_b\" %s", partition_addr);
- ret = system(buf);
- if(ret == 0)
- {
- RLOGD("the partition_nand.xml is new\n");
- }
- else
- {
- RLOGD("the partition_nand.xml is old \n");
- }
- return ret;
-}
static int rock_update_main(unsigned int rom_base, unsigned int backup_base, unsigned int backup_len, int read_rom_directly, int first_run, int switch_slot_flag, int reboot_flag) {
int status,err,start;
@@ -770,17 +747,6 @@
return E_ROCK_FOTA_ADDR;
}
- ret = check_partition();
- if(ret != 0)
- {
- RLOGD("the partition is error\n");
- system("echo fota-interface >/sys/power/wake_unlock");
- return -1;
- }
- else
- {
- RLOGD("the partition is new\n");
- }
memset(&up_info, 0, sizeof(up_info));
memset(&fota_status,0,sizeof(fota_status));