Set BMC boot complete checkpoint in unprovision mode

In non provisional mode, pfr service won't run because in pfr manager
code we are calling exit call to stop pfr service.
Code modified when we recieved FinishTimestamp signal from systemd and
then checking provisional status if pfr is unprovisioned then calling
exit call to stop pfr service.

Modified variable name  from  finishedSettingChkPoint to bmcBootCompleteChkPointDone
Modified function name setBMCBootCheckpoint to setBMCBootCompleteChkPoint

Tested:
During unprovision and provision mode BMC checkpoint is setting to 0x09

Change-Id: I91c1fc1d91a44b32ab94924f76b80c0a393ddde1
Signed-off-by: sri anjaneyulu alapati <srix.anjaneyulu.alapati@intel.com>
diff --git a/libpfr/src/pfr.cpp b/libpfr/src/pfr.cpp
index 61c52f0..0997d76 100644
--- a/libpfr/src/pfr.cpp
+++ b/libpfr/src/pfr.cpp
@@ -82,6 +82,8 @@
     "MAIN_PLD_MINOR_REV_BIT1", "MAIN_PLD_MINOR_REV_BIT0"};
 
 bool exceptionFlag = true;
+extern bool bmcBootCompleteChkPointDone;
+extern bool unProvChkPointStatus;
 
 void init(std::shared_ptr<sdbusplus::asio::connection> conn,
           bool& i2cConfigLoaded)
@@ -525,7 +527,7 @@
     }
 }
 
-int setBMCBootCheckpoint(const uint8_t checkPoint)
+int setBMCBootCompleteChkPoint(const uint8_t checkPoint)
 {
     uint8_t bmcBootCheckpointReg = bmcBootCheckpoint;
 
@@ -557,6 +559,14 @@
         cpldDev.i2cWriteByteData(bmcBootCheckpointReg, checkPoint);
         phosphor::logging::log<phosphor::logging::level::INFO>(
             "Successfully set the PFR CPLD checkpoint 9.");
+        bmcBootCompleteChkPointDone = true;
+        if (unProvChkPointStatus)
+        {
+            unProvChkPointStatus = false;
+            phosphor::logging::log<phosphor::logging::level::INFO>(
+                "PFR is not provisioned, hence exit the service.");
+            std::exit(EXIT_SUCCESS);
+        }
         return 0;
     }
     catch (const std::exception& e)