version: add optional oem version tag (ext/oem-<version>) and log it

This commit is contained in:
Beat Küng
2021-02-18 13:25:22 +01:00
committed by Daniel Agar
parent be3849f0b2
commit c3985709e4
4 changed files with 29 additions and 1 deletions
+12 -1
View File
@@ -84,15 +84,26 @@ except:
git_branch_name = ''
git_version_short = git_version[0:16]
# OEM version
try:
oem_tag = subprocess.check_output('git describe --match ext/oem-* --tags'.split(),
stderr=subprocess.STDOUT).decode('utf-8').strip()
oem_tag = oem_tag[8:]
except:
oem_tag = ''
header += """
#define PX4_GIT_VERSION_STR "{git_version}"
#define PX4_GIT_VERSION_BINARY 0x{git_version_short}
#define PX4_GIT_TAG_STR "{git_tag}"
#define PX4_GIT_BRANCH_NAME "{git_branch_name}"
#define PX4_GIT_OEM_VERSION_STR "{oem_tag}"
""".format(git_tag=git_tag,
git_version=git_version,
git_version_short=git_version_short,
git_branch_name=git_branch_name)
git_branch_name=git_branch_name,
oem_tag=oem_tag)
# ECL
+5
View File
@@ -370,3 +370,8 @@ uint64_t px4_os_version_binary(void)
#endif
}
const char *px4_firmware_oem_version_string(void)
{
return PX4_GIT_OEM_VERSION_STR;
}
+5
View File
@@ -187,5 +187,10 @@ __EXPORT uint64_t px4_mavlink_lib_version_binary(void);
*/
__EXPORT uint64_t px4_os_version_binary(void);
/**
* get the git oem version tag (can be empty, no particular format)
*/
__EXPORT const char *px4_firmware_oem_version_string(void);
__END_DECLS