start supported blob_id list
Each enabled update mechanism can set its own blob_id that can have its
own details.
Change-Id: I363961cea8deb814c3b2e3c416c992fbf955f5e0
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/configure.ac b/configure.ac
index b022138..4c056da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,6 +24,16 @@
AC_CHECK_HEADER([blobs-ipmid], [AC_MSG_ERROR(["phosphor-ipmi-blobs required and not found."])])
AX_PTHREAD([], [AC_MSG_ERROR(["pthread required and not found"])])
+# Configurability
+# Enable static layout for firmware image staging.
+AC_ARG_ENABLE([static-layout],
+ AS_HELP_STRING([--enable-static-layout],
+ [Enable static layout firmware update via Blobs]))
+AS_IF([test "x$enable_static_layout" = "xyes"], [
+ AX_APPEND_COMPILE_FLAGS([-DENABLE_STATIC_LAYOUT], [CXXFLAGS])
+])
+# Enable BlockTransfer, P2A, and or LPC.
+
# Check/set gtest specific functions.
PKG_CHECK_MODULES([GTEST], [gtest], [], [AC_MSG_NOTICE([gtest not found, tests will not build])])
PKG_CHECK_MODULES([GMOCK], [gmock], [], [AC_MSG_NOTICE([gmock not found, tests will not build])])
diff --git a/firmware_handler.cpp b/firmware_handler.cpp
index 97ebf76..b7c0c60 100644
--- a/firmware_handler.cpp
+++ b/firmware_handler.cpp
@@ -1,15 +1,39 @@
+#include "config.h"
+
#include "firmware_handler.hpp"
+#include <string>
+#include <vector>
+
namespace blobs
{
+std::vector<std::string> supportedFirmware = {
+ "/flash/hash",
+#ifdef ENABLE_STATIC_LAYOUT
+ "/flash/image",
+#endif
+};
+
bool FirmwareBlobHandler::canHandleBlob(const std::string& path)
{
return false;
}
std::vector<std::string> FirmwareBlobHandler::getBlobIds()
{
- return {};
+ /*
+ * Grab the list of supported firmware.
+ * If there's an open session, add that to this list.
+ */
+ std::vector<std::string> blobs = supportedFirmware;
+
+ /*
+ * If there's an open firmware session, it'll add "/flash/active/image",
+ * and if the hash has started, "/flash/active/hash" regardless of
+ * mechanism.
+ */
+
+ return blobs;
}
bool FirmwareBlobHandler::deleteBlob(const std::string& path)
{