pnor: Add updatable association to active PNOR FW

Add 'updateable' association to the active PNOR
firmware version object. This 'updateable' association
can be used to mark all the firmware components
which can be programmable from pnor interfaces like
Redfish.

Signed-off-by: Miguel Gomez <mgomez@mx1.ibm.com>
Change-Id: I33f7ac70c8bfa446aeb045c65c741e2d72ce108a
diff --git a/configure.ac b/configure.ac
index ce7bc64..2c1969d 100755
--- a/configure.ac
+++ b/configure.ac
@@ -72,6 +72,9 @@
 AC_DEFINE(ACTIVE_FWD_ASSOCIATION, "active", [The name of the active's forward association.])
 AC_DEFINE(ACTIVE_REV_ASSOCIATION, "software_version", [The name of the active's reverse association.])
 
+AC_DEFINE(UPDATEABLE_FWD_ASSOCIATION, "updateable", [The name of the updateable forward association.])
+AC_DEFINE(UPDATEABLE_REV_ASSOCIATION, "software_version", [The updateable reverse association.])
+
 AC_DEFINE(FUNCTIONAL_FWD_ASSOCIATION, "functional", [The name of the functional forward association.])
 AC_DEFINE(FUNCTIONAL_REV_ASSOCIATION, "software_version", [The functional reverse association.])
 
diff --git a/item_updater.cpp b/item_updater.cpp
index 4fbd717..6fe2702 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -127,6 +127,13 @@
     associations(assocs);
 }
 
+void ItemUpdater::createUpdateableAssociation(const std::string& path)
+{
+    assocs.emplace_back(std::make_tuple(UPDATEABLE_FWD_ASSOCIATION,
+                                        UPDATEABLE_REV_ASSOCIATION, path));
+    associations(assocs);
+}
+
 void ItemUpdater::updateFunctionalAssociation(const std::string& versionId)
 {
     std::string path = std::string{SOFTWARE_OBJPATH} + '/' + versionId;
diff --git a/item_updater.hpp b/item_updater.hpp
index 33dc05b..1fcb2d0 100644
--- a/item_updater.hpp
+++ b/item_updater.hpp
@@ -142,6 +142,13 @@
      */
     virtual void createActiveAssociation(const std::string& path);
 
+    /** @brief Creates a updateable association to the
+     *  "running" BMC software image
+     *
+     * @param[in]  path - The path to create the association.
+     */
+    virtual void createUpdateableAssociation(const std::string& path);
+
     /** @brief Updates the functional association to the
      *  new "running" PNOR image
      *
diff --git a/static/activation_static.cpp b/static/activation_static.cpp
index 19bb19e..8842f05 100644
--- a/static/activation_static.cpp
+++ b/static/activation_static.cpp
@@ -154,6 +154,9 @@
     deleteImageManagerObject();
     // Create active association
     parent.createActiveAssociation(path);
+    // Create updateable association as this
+    // can be re-programmed.
+    parent.createUpdateableAssociation(path);
     // Create functional assocaition
     parent.updateFunctionalAssociation(versionId);
 
diff --git a/static/item_updater_static.cpp b/static/item_updater_static.cpp
index e867a83..21b418c 100644
--- a/static/item_updater_static.cpp
+++ b/static/item_updater_static.cpp
@@ -275,6 +275,10 @@
         createActiveAssociation(path);
     }
 
+    // All updateable firmware components must expose the updateable
+    // association.
+    createUpdateableAssociation(path);
+
     // Create Activation instance for this version.
     activations.insert(std::make_pair(
         id, std::make_unique<ActivationStatic>(bus, path, *this, id,
diff --git a/ubi/activation_ubi.cpp b/ubi/activation_ubi.cpp
index 4575a61..383dc51 100644
--- a/ubi/activation_ubi.cpp
+++ b/ubi/activation_ubi.cpp
@@ -184,6 +184,9 @@
     deleteImageManagerObject();
     // Create active association
     parent.createActiveAssociation(path);
+    // Create updateable association as this
+    // can be re-programmed.
+    parent.createUpdateableAssociation(path);
 }
 
 } // namespace updater
diff --git a/ubi/item_updater_ubi.cpp b/ubi/item_updater_ubi.cpp
index ccc540a..ae6b3fd 100644
--- a/ubi/item_updater_ubi.cpp
+++ b/ubi/item_updater_ubi.cpp
@@ -119,6 +119,10 @@
                 createActiveAssociation(path);
             }
 
+            // All updateable firmware components must expose the updateable
+            // association.
+            createUpdateableAssociation(path);
+
             // Create Activation instance for this version.
             activations.insert(
                 std::make_pair(id, std::make_unique<ActivationUbi>(