kernel update works, but without flash checksum

This commit is contained in:
maliakal_d 2021-11-09 11:42:26 +01:00
parent 33c86db019
commit e81e06696a
2 changed files with 22 additions and 10 deletions

View File

@ -33,7 +33,7 @@
#define CMD_FPGA_PICKED_STATUS "cat /sys/class/gpio/gpio7/value"
#define CMD_GET_FPGA_FLASH_DRIVE "awk \'$4== \"\\\"bitfile(spi)\\\"\" {print $1}\' /proc/mtd"
#define CMD_GET_KERNEL_FLASH_DRIVE "awk \'$4== \"\\\"linux\\\"\" {print $1}\' /proc/mtd"
#define CMD_GET_KERNEL_FLASH_DRIVE "awk \'$4== \"\\\"linux kernel(nor)\\\"\" {print $1}\' /proc/mtd"
#define FLASH_BUFFER_MEMORY_SIZE (128 * 1024) // 500 KB
// clang-format on
@ -313,13 +313,11 @@ int eraseAndWriteToFlash(char *mess, enum PROGRAM_INDEX index,
return FAIL;
}
/* remove condition when flash fpga fixed */
if (index == PROGRAM_KERNEL) {
if (verifyChecksumFromFlash(mess, messageType, clientChecksum,
flashDriveName, fsize) == FAIL) {
return FAIL;
}
}
/* remove condition when flash fpga and flash kernel fixed */
/*if (verifyChecksumFromFlash(mess, messageType, clientChecksum,
flashDriveName, fsize) == FAIL) {
return FAIL;
}*/
if (index == PROGRAM_FPGA) {
if (waitForFPGAtoTouchFlash(mess) == FAIL) {
@ -370,6 +368,13 @@ int getDrive(char *mess, enum PROGRAM_INDEX index) {
return FAIL;
}
if (strlen(retvals) == 0) {
LOG(logERROR, ("Could not %s. Could not get mtd drive, script returned "
"empty string\n",
messageType));
return FAIL;
}
char *pch = strtok(retvals, ":");
if (pch == NULL) {
sprintf(mess,

View File

@ -13,8 +13,8 @@
#define CMD_GET_FPGA_FLASH_DRIVE \
"awk \'$5== \"Application\" {print $1}\' /proc/mtd"
#define CMD_GET_KERNEL_FLASH_DRIVE "awk \'$5== \"Linux\" {print $1}\' /proc/mtd"
#define CMD_GET_KERNEL_FLASH_DRIVE \
"awk \'$5== \"Linux\" && $9 != \"Backup\\\"\" {print $1}\' /proc/mtd"
#define FLASH_DRIVE_NAME_SIZE 16
#ifdef VIRTUAL
@ -121,6 +121,13 @@ int getDrive(char *mess, enum PROGRAM_INDEX index) {
return FAIL;
}
if (strlen(retvals) == 0) {
LOG(logERROR, ("Could not %s. Could not get mtd drive, script returned "
"empty string\n",
messageType));
return FAIL;
}
char *pch = strtok(retvals, ":");
if (pch == NULL) {
sprintf(