rename: Rename firmware to blobid where appropriate
Rename a few variable, such as firmwares, to make it clear when it's a
firmware blobID or just a set of blobIDs.
Move the hash blobID into its own place since it isn't a firmware.
Change-Id: Ia4118d7da72d1e6e6bbe362ca82ad0fe65f394c4
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/firmware_handler.cpp b/firmware_handler.cpp
index 4c076de..23b0925 100644
--- a/firmware_handler.cpp
+++ b/firmware_handler.cpp
@@ -9,17 +9,22 @@
namespace blobs
{
+static std::string hashBlobID = "/flash/hash";
+
std::unique_ptr<GenericBlobInterface>
FirmwareBlobHandler::CreateFirmwareBlobHandler(
const std::vector<std::string>& firmwares, std::uint32_t transports)
{
- return std::make_unique<FirmwareBlobHandler>(firmwares, transports);
+ std::vector<std::string> blobs = firmwares;
+ blobs.push_back(hashBlobID);
+
+ return std::make_unique<FirmwareBlobHandler>(blobs, transports);
}
bool FirmwareBlobHandler::canHandleBlob(const std::string& path)
{
/* Check if the path is in our supported list (or active list). */
- if (std::count(firmwares.begin(), firmwares.end(), path))
+ if (std::count(blobIDs.begin(), blobIDs.end(), path))
{
return true;
}
@@ -37,7 +42,7 @@
* "/flash/active/hash" regardless of mechanism. This is done in the open
* comamnd, no extra work is required here.
*/
- return firmwares;
+ return blobIDs;
}
bool FirmwareBlobHandler::deleteBlob(const std::string& path)
diff --git a/firmware_handler.hpp b/firmware_handler.hpp
index 05bd84d..3eede31 100644
--- a/firmware_handler.hpp
+++ b/firmware_handler.hpp
@@ -25,7 +25,7 @@
/**
* Create a FirmwareBlobHandler.
*
- * @param[in] firmwares - list of blobs_ids to support.
+ * @param[in] firmwares - list of firmware blob_ids to support.
* @param[in] transports - bitmask of transports to support.
*/
static std::unique_ptr<GenericBlobInterface>
@@ -35,12 +35,12 @@
/**
* Create a FirmwareBlobHandler.
*
- * @param[in] firmwares - list of blobs_ids to support.
+ * @param[in] blobs - list of blobs_ids to support.
* @param[in] transports - bitmask of transports to support.
*/
- FirmwareBlobHandler(const std::vector<std::string>& firmwares,
+ FirmwareBlobHandler(const std::vector<std::string>& blobs,
std::uint32_t transports) :
- firmwares(firmwares),
+ blobIDs(blobs),
transports(transports)
{
}
@@ -68,7 +68,7 @@
bool expire(uint16_t session) override;
private:
- std::vector<std::string> firmwares;
+ std::vector<std::string> blobIDs;
std::uint32_t transports;
};
diff --git a/main.cpp b/main.cpp
index 4012a0e..ba2389a 100644
--- a/main.cpp
+++ b/main.cpp
@@ -12,7 +12,6 @@
using namespace phosphor::logging;
std::vector<std::string> supportedFirmware = {
- "/flash/hash",
#ifdef ENABLE_STATIC_LAYOUT
"/flash/image",
#endif