Add support for optional images

Add support to allow optional image files in the BMC tarball.
This can be used for example to add a host bios file in a "System"
image, or for elements that as best practice should not be
updated unless necessary like for a bug fix, such as the U-Boot SPL.

This commit provides the ability to add these optional images from
a list of pre-defined names. These files will then go through the
same checks as the default image files such as checking the files
exist and the signature verification (if enabled) passes.

Change-Id: I304b4e28c776db4a51537613888b4e11824cab88
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/images.cpp b/images.cpp
new file mode 100644
index 0000000..2945f24
--- /dev/null
+++ b/images.cpp
@@ -0,0 +1,28 @@
+#include "config.h"
+
+#include "images.hpp"
+
+#include <iterator>
+#include <sstream>
+#include <string>
+#include <vector>
+
+namespace phosphor
+{
+namespace software
+{
+namespace image
+{
+
+std::vector<std::string> getOptionalImages()
+{
+    std::istringstream optionalImagesStr(OPTIONAL_IMAGES);
+    std::vector<std::string> optionalImages(
+        std::istream_iterator<std::string>{optionalImagesStr},
+        std::istream_iterator<std::string>());
+    return optionalImages;
+}
+
+} // namespace image
+} // namespace software
+} // namespace phosphor