diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index e5b918e..1ce609c 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -109,6 +109,7 @@ struct image { char* fw_ver_build_string; uint16_t fw_ver_major; uint16_t fw_ver_minor; + uint16_t fw_ver_micro; uint16_t fw_ver_build; }; diff --git a/src/manifest.c b/src/manifest.c index cb6d703..d3d7f26 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -776,6 +776,7 @@ int man_write_fw_v1_5(struct image *image) /* firmware and build version */ m->desc.header.major_version = image->fw_ver_major; m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.hotfix_version = image->fw_ver_micro; m->desc.header.build_version = image->fw_ver_build; /* create each module */ @@ -845,6 +846,7 @@ int man_write_fw_v1_5_sue(struct image *image) /* firmware and build version */ m->desc.header.major_version = image->fw_ver_major; m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.hotfix_version = image->fw_ver_micro; m->desc.header.build_version = image->fw_ver_build; /* create each module - subtract the boot loader exec header */ @@ -916,6 +918,7 @@ int man_write_fw_v1_8(struct image *image) m->css.version.build_version = image->fw_ver_build; m->desc.header.major_version = image->fw_ver_major; m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.hotfix_version = image->fw_ver_micro; m->desc.header.build_version = image->fw_ver_build; /* create each module */ @@ -1022,6 +1025,7 @@ int man_write_fw_meu_v1_5(struct image *image) /* firmware and build version */ desc->header.major_version = image->fw_ver_major; desc->header.minor_version = image->fw_ver_minor; + desc->header.hotfix_version = image->fw_ver_micro; desc->header.build_version = image->fw_ver_build; /* create each module */ @@ -1102,6 +1106,7 @@ int man_write_fw_meu_v1_8(struct image *image) /* firmware and build version */ desc->header.major_version = image->fw_ver_major; desc->header.minor_version = image->fw_ver_minor; + desc->header.hotfix_version = image->fw_ver_micro; desc->header.build_version = image->fw_ver_build; /* create each module */ @@ -1182,6 +1187,7 @@ int man_write_fw_meu_v2_5(struct image *image) /* firmware and build version */ desc->header.major_version = image->fw_ver_major; desc->header.minor_version = image->fw_ver_minor; + desc->header.hotfix_version = image->fw_ver_micro; desc->header.build_version = image->fw_ver_build; /* create each module */ @@ -1266,6 +1272,7 @@ int man_write_fw_v2_5(struct image *image) m->css.version.build_version = image->fw_ver_build; m->desc.header.major_version = image->fw_ver_major; m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.hotfix_version = image->fw_ver_micro; m->desc.header.build_version = image->fw_ver_build; /* create each module */ diff --git a/src/rimage.c b/src/rimage.c index 3cf0232..c7b112d 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -26,7 +26,7 @@ static void usage(char *name) fprintf(stdout, "\t -r enable relocatable ELF files\n"); fprintf(stdout, "\t -s MEU signing offset, disables rimage signing\n"); fprintf(stdout, "\t -i set IMR type\n"); - fprintf(stdout, "\t -f firmware version = x.y\n"); + fprintf(stdout, "\t -f firmware version = major.minor.micro\n"); fprintf(stdout, "\t -b build version\n"); fprintf(stdout, "\t -e build extended manifest\n"); fprintf(stdout, "\t -y verify signed file\n"); @@ -115,19 +115,21 @@ int main(int argc, char *argv[]) return -EINVAL; } - /* firmware version and build id */ + /* firmware version: major.minor.micro */ if (image.fw_ver_string) { - ret = sscanf(image.fw_ver_string, "%hu.%hu", + ret = sscanf(image.fw_ver_string, "%hu.%hu.%hu", &image.fw_ver_major, - &image.fw_ver_minor); + &image.fw_ver_minor, + &image.fw_ver_micro); - if (ret != 2) { + if (ret != 3) { fprintf(stderr, - "error: cannot parse firmware version\n"); + "error: cannot parse firmware version major.minor.micro\n"); return -EINVAL; } } + /* firmware build id */ if (image.fw_ver_build_string) { ret = sscanf(image.fw_ver_build_string, "%hu", &image.fw_ver_build);