Skip to content

Commit 33f9703

Browse files
committed
[roc-config] Add flag to optionally bypass the firmware check
1 parent 922d30e commit 33f9703

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

src/CommandLineUtilities/ProgramConfig.cxx

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ class ProgramConfig : public Program
8282
options.add_options()("force-config",
8383
po::bool_switch(&mOptions.forceConfig),
8484
"Flag to force configuration and not check if the configuration is already present");
85+
options.add_options()("bypass-fw-check",
86+
po::bool_switch(&mOptions.bypassFirmwareCheck),
87+
"Flag to force configuration, bypassing the firmware checker");
8588
Options::addOptionCardId(options);
8689
}
8790

@@ -101,23 +104,27 @@ class ProgramConfig : public Program
101104
for (auto const& card : cardsFound) {
102105
std::cout << " __== " << card.pciAddress.toString() << " ==__ " << std::endl;
103106
auto params = Parameters::makeParameters(card.pciAddress, 2);
104-
try {
105-
checkFirmwareCompatibility(params);
106-
CardConfigurator(card.pciAddress, mOptions.configFile, mOptions.forceConfig);
107-
} catch (const Exception& e) {
108-
std::cout << boost::diagnostic_information(e) << std::endl;
107+
if (!mOptions.bypassFirmwareCheck) {
108+
try {
109+
checkFirmwareCompatibility(params);
110+
CardConfigurator(card.pciAddress, mOptions.configFile, mOptions.forceConfig);
111+
} catch (const Exception& e) {
112+
std::cout << boost::diagnostic_information(e) << std::endl;
113+
}
109114
}
110115
}
111116
return;
112117
}
113118

114119
// Configure specific card
115120
auto cardId = Options::getOptionCardId(map);
116-
try {
117-
checkFirmwareCompatibility(cardId);
118-
} catch (const Exception& e) {
119-
std::cout << boost::diagnostic_information(e) << std::endl;
120-
return;
121+
if (!mOptions.bypassFirmwareCheck) {
122+
try {
123+
checkFirmwareCompatibility(cardId);
124+
} catch (const Exception& e) {
125+
std::cout << boost::diagnostic_information(e) << std::endl;
126+
return;
127+
}
121128
}
122129

123130
if (mOptions.configFile == "") {
@@ -163,6 +170,7 @@ class ProgramConfig : public Program
163170
std::string gbtMux = "ttc";
164171
std::string links = "0";
165172
bool allowRejection = false;
173+
bool bypassFirmwareCheck = false;
166174
bool configAll = false;
167175
bool forceConfig = false;
168176
bool linkLoopbackEnabled = false;

0 commit comments

Comments
 (0)