oem-ibm: LID handler: change patch LID dir
Support patching running and alternate LIDs - running side and alternate
side patches will exist in their own directories.
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
Change-Id: I1dc6ead6164d45ccb5168862c6d955891d4b94e8
diff --git a/meson.build b/meson.build
index 017474b..9898884 100644
--- a/meson.build
+++ b/meson.build
@@ -27,7 +27,8 @@
conf_data.set_quoted('FILE_TABLE_JSON', '/usr/share/pldm/fileTable.json')
conf_data.set_quoted('LID_RUNNING_DIR', '/var/lib/phosphor-software-manager/hostfw/running')
conf_data.set_quoted('LID_ALTERNATE_DIR', '/var/lib/phosphor-software-manager/hostfw/alternate')
- conf_data.set_quoted('LID_PATCH_DIR', '/usr/local/share/hostfw/')
+ conf_data.set_quoted('LID_RUNNING_PATCH_DIR', '/usr/local/share/hostfw/running')
+ conf_data.set_quoted('LID_ALTERNATE_PATCH_DIR', '/usr/local/share/hostfw/alternate')
conf_data.set('DMA_MAXSIZE', get_option('oem-ibm-dma-maxsize'))
add_global_arguments('-DOEM_IBM', language : 'c')
add_global_arguments('-DOEM_IBM', language : 'cpp')
diff --git a/oem/ibm/libpldmresponder/file_io_type_lid.hpp b/oem/ibm/libpldmresponder/file_io_type_lid.hpp
index 34fefa9..3086158 100644
--- a/oem/ibm/libpldmresponder/file_io_type_lid.hpp
+++ b/oem/ibm/libpldmresponder/file_io_type_lid.hpp
@@ -32,8 +32,10 @@
std::stringstream stream;
stream << std::hex << fileHandle;
auto lidName = stream.str() + ".lid";
- auto patch = fs::path(LID_PATCH_DIR) / lidName;
- if (!permSide && fs::is_regular_file(patch))
+ std::string patchDir =
+ permSide ? LID_ALTERNATE_PATCH_DIR : LID_RUNNING_PATCH_DIR;
+ auto patch = fs::path(patchDir) / lidName;
+ if (fs::is_regular_file(patch))
{
lidPath = patch;
}