This commit is contained in:
maliakal_d 2021-11-23 15:30:08 +01:00
parent a101e18d60
commit 74348afcf6

View File

@ -256,6 +256,12 @@ int allowKernelUpdate(char *mess) {
#endif #endif
char retvals[MAX_STR_LENGTH] = {0}; char retvals[MAX_STR_LENGTH] = {0};
if (executeCommand(CMD_GET_AMD_FLASH, retvals, logDEBUG1) == FAIL) { if (executeCommand(CMD_GET_AMD_FLASH, retvals, logDEBUG1) == FAIL) {
// no amd found
if (strstr(retvals, "No result") != NULL) {
LOG(logINFO, ("\tNot Amd Flash\n"));
return OK;
}
// could not figure out if amd
snprintf( snprintf(
mess, MAX_STR_LENGTH, mess, MAX_STR_LENGTH,
"Could not update %s. (Could not figure out if Amd flash: %s)\n", "Could not update %s. (Could not figure out if Amd flash: %s)\n",
@ -263,23 +269,17 @@ int allowKernelUpdate(char *mess) {
LOG(logERROR, (mess)); LOG(logERROR, (mess));
return FAIL; return FAIL;
} }
// amd flash found // amd, only current kernel works with amd flash
if (strlen(retvals) > 1) { if (validateKernelVersion(KERNEL_DATE_VRSN_3GPIO) == FAIL) {
LOG(logINFO, ("\tAmd Flash found\n")); getKernelVersion(retvals);
// only current kernel works with amd flash snprintf(mess, MAX_STR_LENGTH,
if (validateKernelVersion(KERNEL_DATE_VRSN_3GPIO) == FAIL) { "Could not update %s. Kernel version %s is too old to "
getKernelVersion(retvals); "update the Amd flash\n",
snprintf(mess, MAX_STR_LENGTH, messageType, retvals);
"Could not update %s. Kernel version %s is too old to " LOG(logERROR, (mess));
"update the Amd flash\n", return FAIL;
messageType, retvals);
LOG(logERROR, (mess));
return FAIL;
}
} else {
LOG(logINFO, ("\tNot Amd Flash\n"));
} }
LOG(logINFO, ("\tKernel and flash ok for updating kernel\n")); LOG(logINFO, ("\tAmd flash with compatible kernel version\n"));
return OK; return OK;
} }