manager: allow running at non-standard path
Add an optional argument to the daemon to allow the persistent
location to be a non-standard path. This enables running the
application as a normal user on a developer system rather than
requiring it to be installed in a full BMC image.
Tested:
Ran with `biosconfig-manager /tmp/bios-config-manager`:
```
$ busctl --user tree xyz.openbmc_project.BIOSConfigManager
└─ /xyz
└─ /xyz/openbmc_project
└─ /xyz/openbmc_project/bios_config
├─ /xyz/openbmc_project/bios_config/manager
└─ /xyz/openbmc_project/bios_config/password
```
Change-Id: I42f688e233060c43983d2690facbb1026e678c77
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/src/password.cpp b/src/password.cpp
index 03aeb79..6503e53 100644
--- a/src/password.cpp
+++ b/src/password.cpp
@@ -15,7 +15,6 @@
*/
#include "password.hpp"
-#include "config.hpp"
#include "xyz/openbmc_project/BIOSConfig/Common/error.hpp"
#include "xyz/openbmc_project/Common/error.hpp"
@@ -235,7 +234,8 @@
}
}
Password::Password(sdbusplus::asio::object_server& objectServer,
- std::shared_ptr<sdbusplus::asio::connection>& systemBus) :
+ std::shared_ptr<sdbusplus::asio::connection>& systemBus,
+ std::string persistPath) :
sdbusplus::xyz::openbmc_project::BIOSConfig::server::Password(
*systemBus, objectPathPwd),
objServer(objectServer), systemBus(systemBus)
@@ -243,7 +243,7 @@
lg2::debug("BIOS config password is running");
try
{
- fs::path biosDir(BIOS_PERSIST_PATH);
+ fs::path biosDir(persistPath);
fs::create_directories(biosDir);
seedFile = biosDir / biosSeedFile;
}