vpnor: Look for files in rw directory first

IBM systems running PLDM create lid files for the host content instead
of PNOR partition files:
```
https://github.com/openbmc/pldm/blob/master/oem/ibm/configurations/fileTable.json
```

In order to continue to support mboxd (hiomapd), symlinks with the PNOR
partition file names are created to point to the lid files:
https://gerrit.openbmc.org/c/openbmc/openpower-pnor-code-mgmt/+/45249

Since these symlinks are created at runtime, they can only be created in
the read-write directory.
Update the mboxd (hiomapd) code to look at the rw directory first, since
in general the code searches in patch directories first to allow
overrides. Then if the partition files are not found default to the
read-only directory.

The symlinks are created prior to mboxd starting via a Before dependency
in the openpower service file:
```
https://github.com/openbmc/openpower-pnor-code-mgmt/blob/master/mmc/openpower-update-bios-attr-table.service#L6
```

Tested: Verified mboxd started successfully in a p10bmc and witherspoon
system.

Change-Id: I281cd41591ab55cd1b3de474ad25c5992ea2d498
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/vpnor/table.cpp b/vpnor/table.cpp
index 9d601e3..853c129 100644
--- a/vpnor/table.cpp
+++ b/vpnor/table.cpp
@@ -79,8 +79,13 @@
 void Table::preparePartitions(const struct vpnor_data* priv)
 {
     const fs::path roDir(priv->paths.ro_loc);
+    const fs::path rwDir(priv->paths.rw_loc);
     const fs::path patchDir(priv->paths.patch_loc);
-    fs::path tocFile = roDir / PARTITION_TOC_FILE;
+    fs::path tocFile = rwDir / PARTITION_TOC_FILE;
+    if (!fs::exists(tocFile))
+    {
+        tocFile = roDir / PARTITION_TOC_FILE;
+    }
     allocateMemory(tocFile);
 
     std::ifstream file(tocFile.c_str());
@@ -134,7 +139,11 @@
             }
         }
 
-        file = roDir / part.data.name;
+        file = rwDir / part.data.name;
+        if (!fs::exists(file))
+        {
+            file = roDir / part.data.name;
+        }
         if (!fs::exists(file))
         {
             std::stringstream err;