| # Base image version class extension |
| DEPENDS:append = " os-release" |
| def do_get_os_release_value(d, key): |
| path = d.getVar('STAGING_DIR_TARGET', True) + d.getVar('sysconfdir', True) |
| path = os.path.join(path, 'os-release') |
| parser = configparser.ConfigParser(strict=False) |
| with open(path, 'r') as fd: |
| buf = '[root]\n' + fd.read() |
| value = parser['root'][key] |
| version = do_get_os_release_value(d, 'VERSION_ID') |
| version = do_get_version(d) |
| version = version.strip('"') |
| version_id = (hashlib.sha512(version.encode('utf-8')).hexdigest())[:8] |
| build_id = do_get_os_release_value(d, 'BUILD_ID') |
| def do_get_extended_version(d): |
| extended_version = do_get_os_release_value(d, 'EXTENDED_VERSION') |