image_types_phosphor: Add compatible name to MANIFEST

This adds CompatibleNames field to the manifest file which can contain
compatibility strings as described in the Software interface.

The field is set by the OBMC_COMPATIBLE_NAMES variable in the
machine.conf file, e.g.

OBMC_COMPATIBLE_NAMES = "\
    foo.bar \
    baz.bim \
"

Also omit ExtendedVersion from the manifest file if it is not set.

Signed-off-by: Justin Ledford <justinledford@google.com>
Change-Id: Id27b4d6ec25ec7c3d3d5942368f40e618535eafe
diff --git a/meta-phosphor/classes/image_types_phosphor.bbclass b/meta-phosphor/classes/image_types_phosphor.bbclass
index 64fec00..206b080 100644
--- a/meta-phosphor/classes/image_types_phosphor.bbclass
+++ b/meta-phosphor/classes/image_types_phosphor.bbclass
@@ -504,12 +504,17 @@
     version = do_get_version(d)
     build_id = do_get_buildID(d)
     target_machine = d.getVar('MACHINE', True)
-    extended_version = (d.getVar('EXTENDED_VERSION', True) or "")
+    extended_version = d.getVar('EXTENDED_VERSION', True)
+    compatible_names = d.getVar('OBMC_COMPATIBLE_NAMES', True)
     with open('MANIFEST', 'w') as fd:
         fd.write('purpose={}\n'.format(purpose))
         fd.write('version={}\n'.format(version.strip('"')))
         fd.write('BuildId={}\n'.format(build_id.strip('"')))
-        fd.write('ExtendedVersion={}\n'.format(extended_version))
+        if extended_version:
+          fd.write('ExtendedVersion={}\n'.format(extended_version))
+        if compatible_names:
+          for name in compatible_names.split():
+            fd.write('CompatibleName={}\n'.format(name))
         fd.write('KeyType={}\n'.format(get_pubkey_type(d)))
         fd.write('HashType=RSA-SHA256\n')
         fd.write('MachineName={}\n'.format(target_machine))