firmware-utils: tplink-safeloader: use revision field
authorSander Vanheule <sander@svanheule.net>
Wed, 1 Sep 2021 19:15:57 +0000 (21:15 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Thu, 9 Sep 2021 21:36:13 +0000 (23:36 +0200)
The structured soft-version partition has a field which contains a
(source) revision number. Factory images used to include this, but
it was accidentaly removed during an earlier refactoring.

Include the source revision number again in the generated soft-version
partition. Additionaly, also show this revision number when printing
image info.

Fixes: 1a211af2cb3b ("firmware-utils: tplink-safeloader: refactor meta-partition generation")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
tools/firmware-utils/Makefile
tools/firmware-utils/src/tplink-safeloader.c

index 7b669ac0c661bb4ec8bebac7a7674cc8d444080d..ccc5e4609180f9b8060f851758fb79672634e9ed 100644 (file)
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME := firmware-utils
-PKG_RELEASE := 9
+PKG_RELEASE := 10
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/kernel.mk
index 597c48b9d4f48b26ef3a79d0ee2b4ef2de42e57d..dcc9d877a9214557c06333fe1f26721689d7809a 100644 (file)
@@ -2722,6 +2722,7 @@ static struct image_partition_entry make_soft_version(
                .year_lo = bcd(tm->tm_year%100),
                .month = bcd(tm->tm_mon+1),
                .day = bcd(tm->tm_mday),
+               .rev = htonl(rev),
 
                .compat_level = htonl(info->soft_ver_compat_level)
        };
@@ -3411,6 +3412,7 @@ static int firmware_info(const char *input)
 
                        printf("Version: %d.%d.%d\n", s->version_major, s->version_minor, s->version_patch);
                        printf("Date: %02x%02x-%02x-%02x\n", s->year_hi, s->year_lo, s->month, s->day);
+                       printf("Revision: %d\n", ntohl(s->rev));
                } else {
                        printf("Failed to parse data\n");
                }