summaryrefslogtreecommitdiff
path: root/special-mode-mgr/src/specialmodemgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'special-mode-mgr/src/specialmodemgr.cpp')
-rw-r--r--special-mode-mgr/src/specialmodemgr.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/special-mode-mgr/src/specialmodemgr.cpp b/special-mode-mgr/src/specialmodemgr.cpp
index f1ed722..44f12cc 100644
--- a/special-mode-mgr/src/specialmodemgr.cpp
+++ b/special-mode-mgr/src/specialmodemgr.cpp
@@ -50,6 +50,15 @@ SpecialModeMgr::SpecialModeMgr(
timer(std::make_unique<boost::asio::steady_timer>(io))
{
+#ifdef BMC_VALIDATION_UNSECURE_FEATURE
+ if (std::filesystem::exists(validationModeFile))
+ {
+ specialMode = validationUnsecure;
+ addSpecialModeProperty();
+ return;
+ }
+#endif
+
// Following condition must match to indicate specialMode.
// Mark the mode as None for any failure.
// 1. U-Boot detected power button press & indicated "special=mfg"
@@ -195,6 +204,17 @@ void SpecialModeMgr::addSpecialModeProperty()
strSpecialMode, specialMode,
// Ignore set
[this](const uint8_t& req, uint8_t& propertyValue) {
+#ifdef BMC_VALIDATION_UNSECURE_FEATURE
+ if ((req == validationUnsecure) && (specialMode != req))
+ {
+ std::ofstream output(validationModeFile);
+ output.close();
+ specialMode = req;
+ propertyValue = req;
+ return 1;
+ }
+#endif
+
if (req == manufacturingExpired && specialMode != req)
{
specialMode = req;