pfr-manager: revert to last stable revision

This removes following three commits.

1) Revert "checkPfrPlatform: Fix for reading the Baseboard name"
This reverts commit ea670f519e8f30028f8730059e1ccd3779e8c1bc.
2) Revert "Fix: remove "intel-" prefix for binary"
This reverts commit 486b00ab8fe44416b915197b7f85f6bec154e283.
3) Revert "fix for false PFR ProvisioningStatus in redfish"
This reverts commit 019ad89d45eb953746766143f55f683f4b8b3d8d.

The checkPfrPlatform script has some stability issues due
to entity-manager and object mapper dependencies. Its
decided to move this logic to pfr-manager service which
also gives option for exposing CPLD version in PFR not
provisioned case.
This revision is already used in last release version.

Tested:
 - This revision of code is used in last release version
   and all kind of stress tested passed.

Change-Id: I3418585ac9bfe936c66f6fa8166c1e68a6d2ebda
Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a794eaa..a6c976e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,6 +10,3 @@
 
 set(SERVICE_FILES ${PROJECT_SOURCE_DIR}/xyz.openbmc_project.PFR.Manager.service)
 install(FILES ${SERVICE_FILES} DESTINATION /lib/systemd/system/)
-
-set(SCRIPT_FILES ${PROJECT_SOURCE_DIR}/checkPfrPlatform.sh)
-install(PROGRAMS ${SCRIPT_FILES} DESTINATION /usr/bin/)
diff --git a/checkPfrPlatform.sh b/checkPfrPlatform.sh
deleted file mode 100644
index 7d514c9..0000000
--- a/checkPfrPlatform.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/sh
-
-PFR_ID_REG=0x00
-PFR_PROV_REG=0x0a
-
-pfr_active_mode() {
-    busctl introspect xyz.openbmc_project.EntityManager $board/PFR >&/dev/null || return 1
-    address=$(busctl get-property xyz.openbmc_project.EntityManager $board/PFR xyz.openbmc_project.Configuration.PFR Address | cut -b 3-) || return 1
-    bus=$(busctl get-property xyz.openbmc_project.EntityManager $board/PFR xyz.openbmc_project.Configuration.PFR Bus | cut -b 3-) || return 1
-    #check for 0xde in register file 0
-    local id=$(i2cget -y $bus $address $PFR_ID_REG 2>/dev/null) || return 1
-    [ "$id" == "0xde" ] || return 1
-    local prov=$(i2cget -y $bus $address $PFR_PROV_REG 2>/dev/null) || return 1
-    prov=$((prov & 0x20))
-    [ "$prov" == "32" ] && return 0
-    return 1
-}
-
-
-#Read board name
-counter=0
-board=$(busctl call xyz.openbmc_project.ObjectMapper /xyz/openbmc_project/object_mapper xyz.openbmc_project.ObjectMapper  GetSubTreePaths sias "/xyz/openbmc_project/inventory" 0 1 "xyz.openbmc_project.Inventory.Item.Board.Motherboard" | cut -b 7- | sed 's/.$//')
-
-while [ -z "$board" ]
-do
-   board=$(busctl call xyz.openbmc_project.ObjectMapper /xyz/openbmc_project/object_mapper xyz.openbmc_project.ObjectMapper  GetSubTreePaths sias "/xyz/openbmc_project/inventory" 0 1 "xyz.openbmc_project.Inventory.Item.Board.Motherboard" | cut -b 7- | sed 's/.$//')
-   if [ $counter -eq 5 ]
-   then
-       echo "Unable to get board name"
-       exit
-   fi
-   counter=`expr $counter + 1`
-   sleep 10
-done
-
-echo "Baseboard is=$board"
-
-if pfr_active_mode
-then
-    echo "Starting PFR manager service"
-    /usr/bin/pfr-manager
-    exit
-else
-    echo "PFR not supported on this platforms and so not starting PFR manager service."
-    exit
-fi
diff --git a/xyz.openbmc_project.PFR.Manager.service b/xyz.openbmc_project.PFR.Manager.service
index f63acb6..100fc09 100644
--- a/xyz.openbmc_project.PFR.Manager.service
+++ b/xyz.openbmc_project.PFR.Manager.service
@@ -1,13 +1,14 @@
 [Unit]
 Description=Daemon manages PFR dbus properties and Event logs
-After=xyz.openbmc_project.EntityManager.service
-After=xyz.openbmc_project.ObjectMapper.service
 
 [Service]
-Restart=on-failure
-ExecStart=/usr/bin/checkPfrPlatform.sh
+Restart=always
+ExecStart=/usr/bin/pfr-manager
 RestartSec=5
 StartLimitInterval=0
+SyslogIdentifier=pfr-manager
+Type=dbus
+BusName=xyz.openbmc_project.PFR.Manager
 
 [Install]
 WantedBy=multi-user.target