diff options
author | Adriana Kobylak <anoo@us.ibm.com> | 2017-07-22 11:10:43 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-08-02 20:21:08 +0000 |
commit | c71dfd79ebec73e783888fee262b0952bc2040f4 (patch) | |
tree | 517546b4047402846a7bdf5c1377c95c092193f4 /pnor_partition.cpp | |
parent | 88c7406fa047c2c0eff4cbbac4ab40ba07307625 (diff) | |
download | phosphor-mboxd-c71dfd79ebec73e783888fee262b0952bc2040f4.tar.gz phosphor-mboxd-c71dfd79ebec73e783888fee262b0952bc2040f4.zip |
vpnor: Add patch location
Look for the requested partition in the designated patch location
(/usr/local/share/pnor/). If the partition is not found there,
continue with the existing logic of looking in the other partition
directories.
This allows users to use patches in the virtual pnor implementation.
Resolves openbmc/openbmc#1551
Change-Id: I7f27dfc9cd69a3f8ab88cb6fa77b2c1096e32841
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'pnor_partition.cpp')
-rw-r--r-- | pnor_partition.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pnor_partition.cpp b/pnor_partition.cpp index ba0ac20..1d5ca12 100644 --- a/pnor_partition.cpp +++ b/pnor_partition.cpp @@ -69,6 +69,14 @@ std::string Request::getPartitionFilePath(struct mbox_context* context, fs::path partitionFilePath; + // Check if partition exists in patch location + partitionFilePath = context->paths.patch_loc; + partitionFilePath /= partition->data.name; + if (fs::is_regular_file(partitionFilePath)) + { + return partitionFilePath.string(); + } + switch (partition->data.user.data[1] & (PARTITION_PRESERVED | PARTITION_READONLY)) { |