diff options
author | Mikhail Zhilkin <csharper2005@gmail.com> | 2022-12-02 15:26:17 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2023-06-17 12:59:37 +0200 |
commit | 63942b569e08a6190ec9096a03d184127b8f3f71 (patch) | |
tree | 63c1e9f1ceae2f72883ae2ac725a75c816aabb9e /scripts | |
parent | e9d2ff8045f803ec5c90b965946fa1162d5a5699 (diff) | |
download | upstream-63942b569e08a6190ec9096a03d184127b8f3f71.tar.gz upstream-63942b569e08a6190ec9096a03d184127b8f3f71.tar.bz2 upstream-63942b569e08a6190ec9096a03d184127b8f3f71.zip |
scripts: sercomm-kernel-header.py: improve compatibility
This improves compatibility with the elder stock firmwares of the
following devices, which have not yet been merged into OpenWrt:
- Beeline SmartBox Pro
- Beeline SmartBox Turbo+
- WiFire S1500.NBN
Without this, OpenWrt factory image installation may fail.
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Signed-off-by: Maximilian Weinmann <x1@disroot.org>
(cherry picked from commit 35a4418d3966ccf6229916b0021bd18871ef22dd)
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/sercomm-kernel-header.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/sercomm-kernel-header.py b/scripts/sercomm-kernel-header.py index bfb29c6fe0..40bcbb1385 100755 --- a/scripts/sercomm-kernel-header.py +++ b/scripts/sercomm-kernel-header.py @@ -48,12 +48,12 @@ def get_kernel_header(args): struct.pack_into('<L', header, 0x2c, rootfs_size) struct.pack_into('<L', header, 0x30, crc) - rootfs_end_offset = args.rootfs_offset + rootfs_size - struct.pack_into('<L', header, 0x4, rootfs_end_offset) - kernel_size = os.path.getsize(args.kernel_file) struct.pack_into('<L', header, 0x14, kernel_size) + kernel_end_offset = args.kernel_offset + kernel_size + struct.pack_into('<L', header, 0x4, kernel_end_offset) + buf = open(args.kernel_file,'rb').read() crc = binascii.crc32(buf) & 0xffffffff struct.pack_into('<L', header, 0x18, crc) |