diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-07-25 03:51:51 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-08-01 22:02:14 +0300 |
commit | 0e1e65f6aaf31830b8d90a66430389bf905eab1c (patch) | |
tree | 46d76ca524684ca5abaca7e2138636472ea967af /meta-phosphor/classes | |
parent | 527177383e35ef7652cca498a57801d8797badc1 (diff) | |
download | openbmc-0e1e65f6aaf31830b8d90a66430389bf905eab1c.tar.xz |
overlay: Add MANIFEST to tar files
Add a manifest file to the tar archives generated for use with
Phosphor software management. The manifest is used by Phosphor
software management applications to determine the purpose and
version of the software in the tar archive.
Change-Id: Ic364297d7bae09909fafaa11d4b8324b42cfc064
Resolves: openbmc/openbmc#1842
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-phosphor/classes')
-rw-r--r-- | meta-phosphor/classes/image-overlay.bbclass | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/meta-phosphor/classes/image-overlay.bbclass b/meta-phosphor/classes/image-overlay.bbclass index ff97605b9..1e2105ccb 100644 --- a/meta-phosphor/classes/image-overlay.bbclass +++ b/meta-phosphor/classes/image-overlay.bbclass @@ -65,7 +65,7 @@ do_generate_flash() { ln -sf $flash ${IMGDEPLOYDIR}/flash-${MACHINE} } -do_generate_tars() { +make_overlay_tars() { ddir="${IMGDEPLOYDIR}" kernel="${FLASH_KERNEL_IMAGE}" uboot="u-boot.${UBOOT_SUFFIX}" @@ -84,8 +84,8 @@ do_generate_tars() { ln -sf $rwfs ${S}/image-rwfs # Create the tar archives - tar -h -cvf $ddir/$alltar -C ${S} image-bmc - tar -h -cvf $ddir/$tar -C ${S} image-u-boot image-kernel image-rofs image-rwfs + tar -h -cvf $ddir/$alltar -C ${S} image-bmc MANIFEST + tar -h -cvf $ddir/$tar -C ${S} image-u-boot image-kernel image-rofs image-rwfs MANIFEST cd ${IMGDEPLOYDIR} ln -sf $alltar ${IMGDEPLOYDIR}/${IMAGE_LINK_NAME}.all.tar @@ -96,7 +96,32 @@ do_generate_tars() { ln -sf $alltar ${IMGDEPLOYDIR}/${MACHINE}-${DATETIME}.all.tar } -do_generate_tars[vardepsexclude] = "DATETIME" +make_overlay_tars[vardepsexclude] = "DATETIME" + +def generate_manifest(d): + import configparser + import io + path = d.getVar('STAGING_DIR_HOST', True) + d.getVar('sysconfdir', True) + path = os.path.join(path, 'os-release') + parser = configparser.SafeConfigParser(strict=False) + parser.optionxform = str + version = '' + with open(path, 'r') as fd: + buf = '[root]\n' + fd.read() + fd = io.StringIO(buf) + parser.readfp(fd) + version = parser['root']['VERSION_ID'] + + with open(os.path.join(d.getVar('S', True), 'MANIFEST'), 'w') as fd: + fd.write('purpose=xyz.openbmc_project.Software.Version.VersionPurpose.BMC\n') + fd.write('version={}\n'.format(version.strip('"'))) + + +python do_generate_tars() { + generate_manifest(d) + bb.build.exec_func('make_overlay_tars', d) +} + do_generate_flash[depends] += " \ ${PN}:do_image_${@d.getVar('IMAGE_BASETYPE', True).replace('-', '_')} \ @@ -106,6 +131,7 @@ do_generate_flash[depends] += " \ do_generate_tars[depends] += " \ ${PN}:do_generate_flash \ + os-release:do_populate_sysroot \ " addtask generate_flash before do_image_complete |