Skip to content

Commit

Permalink
scripts: sercomm-kernel-header.py: improve compatibility
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Maximilian Weinmann <[email protected]>
(cherry picked from commit 35a4418)
  • Loading branch information
csharper2005 authored and hauke committed Jun 17, 2023
1 parent e9d2ff8 commit 63942b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/sercomm-kernel-header.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 63942b5

Please sign in to comment.