diff options
| author | Paul Spooren | 2026-09-23 13:26:40 +0000 |
|---|---|---|
| committer | Paul Spooren | 2026-09-24 11:36:49 +0000 |
| commit | 98bc30d154f67557598a2114463e9b97c915463d (patch) | |
| tree | 9b9b4cea89e07f8a4fda4f0b4befbc95899c6417 | |
| parent | 18304dd7474dcc2df040f1426c4e6d3f0dedb9b5 (diff) | |
realtek: take the Belkin header time from SOURCE_DATE_EPOCH
The factory images of the Linksys LGS3xxC switches differ between
builds in the Belkin header:
-00000000: 0780 0001 7917 f807 6ab3 0fe3 0058 2000 ....y...j....X .
+00000000: 0780 0001 2a5a 3f79 6ab3 d0c7 0058 2000 ....*Z?yj....X .
belkin-header.py stores time.time() as the image time, which also
changes the header checksum. Use SOURCE_DATE_EPOCH when it is set, like
linksys-image.sh does for the tarball inside.
Link: https://github.com/openwrt/openwrt/pull/25355
Signed-off-by: Paul Spooren <mail@aparcar.org>
| -rwxr-xr-x | scripts/belkin-header.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/belkin-header.py b/scripts/belkin-header.py index f62d55cab7..d6adbc1f11 100755 --- a/scripts/belkin-header.py +++ b/scripts/belkin-header.py @@ -62,7 +62,7 @@ def create_header(buf, belkin_header, belkin_model): head = bytearray(32) head[0:4] = int(belkin_header, 0).to_bytes(4, 'big') - head[8:12] = int(time.time()).to_bytes(4, 'big') + head[8:12] = int(os.environ.get('SOURCE_DATE_EPOCH') or time.time()).to_bytes(4, 'big') head[12:16] = len(buf).to_bytes(4, byteorder='big') head[24:28] = xcrc32(buf) head[28:29] = VERSION1.to_bytes(1, byteorder='big') |