test if special file when updating kernel(solution: reboot only), --force-delete-normal-file used to force delete bfin fpga drive if normal file and create proper device tree

This commit is contained in:
2022-03-22 16:44:12 +01:00
parent f538b8b10b
commit 0f4bcf3a9d
11 changed files with 194 additions and 57 deletions

View File

@ -2551,12 +2551,14 @@ void Module::setAdditionalJsonParameter(const std::string &key,
}
// Advanced
void Module::programFPGA(std::vector<char> buffer) {
void Module::programFPGA(std::vector<char> buffer,
const bool forceDeleteNormalFile) {
switch (shm()->detType) {
case JUNGFRAU:
case CHIPTESTBOARD:
case MOENCH:
sendProgram(true, buffer, F_PROGRAM_FPGA, "Update Firmware");
sendProgram(true, buffer, F_PROGRAM_FPGA, "Update Firmware", "",
forceDeleteNormalFile);
break;
case MYTHEN3:
case GOTTHARD2:
@ -3547,7 +3549,8 @@ sls_detector_module Module::readSettingsFile(const std::string &fname,
void Module::sendProgram(bool blackfin, std::vector<char> buffer,
const int functionEnum,
const std::string &functionType,
const std::string serverName) {
const std::string serverName,
const bool forceDeleteNormalFile) {
LOG(logINFO) << "Module " << moduleIndex << " (" << shm()->hostname
<< "): Sending " << functionType;
@ -3571,6 +3574,11 @@ void Module::sendProgram(bool blackfin, std::vector<char> buffer,
client.Send(sname);
}
// send forceDeleteNormalFile flag
if (blackfin) {
client.Send(static_cast<int>(forceDeleteNormalFile));
}
// validate memory allocation etc in detector
if (client.Receive<int>() == FAIL) {
std::ostringstream os;