mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-16 18:31:31 +01:00
update mode to skip firmware checks and setupDetector, kernel check added to m3and g2
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
|
||||
// Global variable from slsDetectorServer_funcs
|
||||
extern int debugflag;
|
||||
extern int updateFlag;
|
||||
extern int checkModuleFlag;
|
||||
extern udpStruct udpDetails;
|
||||
extern const enum detectorType myDetectorType;
|
||||
@@ -92,8 +93,9 @@ void basictests() {
|
||||
return;
|
||||
}
|
||||
// does check only if flag is 0 (by default), set by command line
|
||||
if ((!debugflag) && ((checkType() == FAIL) || (testFpga() == FAIL) ||
|
||||
(testBus() == FAIL))) {
|
||||
if ((!debugflag) && (!updateFlag) &&
|
||||
((checkKernelVersion() == FAIL) || (checkType() == FAIL) ||
|
||||
(testFpga() == FAIL) || (testBus() == FAIL))) {
|
||||
sprintf(initErrorMessage,
|
||||
"Could not pass basic tests of FPGA and bus. Dangerous to "
|
||||
"continue. (Firmware version:0x%llx) \n",
|
||||
@@ -131,7 +133,7 @@ void basictests() {
|
||||
(long long int)client_sw_apiversion));
|
||||
|
||||
// return if flag is not zero, debug mode
|
||||
if (debugflag) {
|
||||
if (debugflag || updateFlag) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -175,6 +177,25 @@ void basictests() {
|
||||
#endif
|
||||
}
|
||||
|
||||
int checkKernelVersion() {
|
||||
#ifdef VIRTUAL
|
||||
return OK;
|
||||
#endif
|
||||
char output[256];
|
||||
memset(output, 0, 256);
|
||||
FILE *sysFile = popen("uname -a | cut -d ' ' -f5-10", "r");
|
||||
fgets(output, sizeof(output), sysFile);
|
||||
pclose(sysFile);
|
||||
|
||||
if (strstr(output, KERNEL_DATE_VRSN) == NULL) {
|
||||
LOG(logERROR, ("Kernel Version Incompatible! Expected: %s, Got: %s\n",
|
||||
KERNEL_DATE_VRSN, output));
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFO, ("Kernel Version Compatible: %s\n", output));
|
||||
return OK;
|
||||
}
|
||||
|
||||
int checkType() {
|
||||
#ifdef VIRTUAL
|
||||
return OK;
|
||||
@@ -326,7 +347,7 @@ u_int32_t getDetectorIP() {
|
||||
/* initialization */
|
||||
|
||||
void initControlServer() {
|
||||
if (initError == OK) {
|
||||
if (!updateFlag && initError == OK) {
|
||||
setupDetector();
|
||||
}
|
||||
initCheckDone = 1;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "sls_detector_defs.h"
|
||||
|
||||
#define REQRD_FRMWRE_VRSN (0x200707)
|
||||
#define KERNEL_DATE_VRSN "Wed May 20 13:58:38 CEST 2020"
|
||||
|
||||
#define CTRL_SRVR_INIT_TIME_US (300 * 1000)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user