mmc: Handle missing pnor.toc file
The pnor.toc file is a mboxd implemenation, and therefore will not exist
once the host uses PLDM instead, which uses .lid files instead of pnor
partition files. As part of the transition, the pnor.toc file is being
built into a .lid file for images that do not contain pnor partition
files. Handle this transition by creating a symlink from pnor partition
file to .lid file. This would remain in place until all the PLDM support
from the hostboot side is in place and mboxd is removed.
Tested: Verified rainier powers on and mboxd starts successfully, and
the volatile partition gets cleared.
Change-Id: I59364c0abf100dab5a38d277f0587d0dd221b53d
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/functions.cpp b/functions.cpp
index 0404d00..db7f529 100644
--- a/functions.cpp
+++ b/functions.cpp
@@ -220,6 +220,16 @@
return;
}
+ // Create a symlink for pnor.toc
+ static const auto tocLid = "81e00994.lid";
+ auto tocLidPath = hostFirmwareDirectory / tocLid;
+ if (std::filesystem::exists(tocLidPath))
+ {
+ static const auto tocName = "pnor.toc";
+ auto tocLinkPath = hostFirmwareDirectory / tocName;
+ makeCallback(linkCallback, tocLid, tocLinkPath, errorCallback);
+ }
+
for (; directoryIterator != std::filesystem::end(directoryIterator);
directoryIterator.increment(ec))
{