From 74348afcf6f4629857db0f742c8f5cb5807142e9 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Tue, 23 Nov 2021 15:30:08 +0100 Subject: [PATCH] fix --- .../src/programViaBlackfin.c | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/slsDetectorServers/slsDetectorServer/src/programViaBlackfin.c b/slsDetectorServers/slsDetectorServer/src/programViaBlackfin.c index bc418f923..276f84dfe 100644 --- a/slsDetectorServers/slsDetectorServer/src/programViaBlackfin.c +++ b/slsDetectorServers/slsDetectorServer/src/programViaBlackfin.c @@ -256,6 +256,12 @@ int allowKernelUpdate(char *mess) { #endif char retvals[MAX_STR_LENGTH] = {0}; 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( mess, MAX_STR_LENGTH, "Could not update %s. (Could not figure out if Amd flash: %s)\n", @@ -263,23 +269,17 @@ int allowKernelUpdate(char *mess) { LOG(logERROR, (mess)); return FAIL; } - // amd flash found - if (strlen(retvals) > 1) { - LOG(logINFO, ("\tAmd Flash found\n")); - // only current kernel works with amd flash - if (validateKernelVersion(KERNEL_DATE_VRSN_3GPIO) == FAIL) { - getKernelVersion(retvals); - snprintf(mess, MAX_STR_LENGTH, - "Could not update %s. Kernel version %s is too old to " - "update the Amd flash\n", - messageType, retvals); - LOG(logERROR, (mess)); - return FAIL; - } - } else { - LOG(logINFO, ("\tNot Amd Flash\n")); + // amd, only current kernel works with amd flash + if (validateKernelVersion(KERNEL_DATE_VRSN_3GPIO) == FAIL) { + getKernelVersion(retvals); + snprintf(mess, MAX_STR_LENGTH, + "Could not update %s. Kernel version %s is too old to " + "update the Amd flash\n", + messageType, retvals); + LOG(logERROR, (mess)); + return FAIL; } - LOG(logINFO, ("\tKernel and flash ok for updating kernel\n")); + LOG(logINFO, ("\tAmd flash with compatible kernel version\n")); return OK; }