mmc: Create a symlink for HBB to its LID file

With the eventual switch for the host firmware to use PLDM, the vpnor
partition files would not exist anymore. As a temporary transition, need
to create a symlink from HBB to its LID file for the existing mboxd
process to load the data into memory. Eventually, a new lightweight
application would load the contents of this LID file into memory, at
which point this symlink could be removed.

Additionally, the vpnor partition names and their corresponding LID
numbers will be read via a json file as part of the PLDM transition, so
this hardcoded LID number can be dynamically be determined at that
point.

Tested: Verified symlink got created in Rainier and it booted to OS.

mboxd trace:
[ 1621534119.097184649] Fulfilling read request against
/var/lib/phosphor-software-manager/pnor/rw/HBB at offset 0x0 into
0x72879000 for 1048576

$ ls -l /var/lib/phosphor-software-manager/pnor/rw/HBB
lrwxrwxrwx    1 root     root            12 May 20 17:58
/var/lib/phosphor-software-manager/pnor/rw/HBB -> 81e0065a.lid

Change-Id: I1d8362b5b9205f6e16f950e5a94fd417402b9f63
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/functions.cpp b/functions.cpp
index 1780c87..40af65a 100644
--- a/functions.cpp
+++ b/functions.cpp
@@ -152,6 +152,16 @@
         return;
     }
 
+    // Create a symlink from HBB to the corresponding LID file if it exists
+    static const auto hbbLid = "81e0065a.lid";
+    auto hbbLidPath = hostFirmwareDirectory / hbbLid;
+    if (std::filesystem::exists(hbbLidPath))
+    {
+        static const auto hbbName = "HBB";
+        auto hbbLinkPath = hostFirmwareDirectory / hbbName;
+        makeCallback(linkCallback, hbbLid, hbbLinkPath, errorCallback);
+    }
+
     for (; directoryIterator != std::filesystem::end(directoryIterator);
          directoryIterator.increment(ec))
     {