mirror of
https://github.com/Ai-Thinker-Open/Ai-Thinker-Open_RTL8710BX_ALIOS_SDK.git
synced 2025-07-31 19:31:05 +00:00
rel_1.6.0 init
This commit is contained in:
commit
27b3e2883d
19359 changed files with 8093121 additions and 0 deletions
13
tools/asr5501/add_md5.py
Normal file
13
tools/asr5501/add_md5.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
import sys, hashlib
|
||||
|
||||
def MD5(bytes):
|
||||
md5 = hashlib.md5()
|
||||
md5.update(bytes)
|
||||
return md5.hexdigest().decode('hex')
|
||||
|
||||
ota_bin = sys.argv[1]
|
||||
|
||||
with open(ota_bin, 'rb') as file:
|
||||
ota_md5_bytes = MD5(file.read())
|
||||
with open(ota_bin, 'ab') as file:
|
||||
file.write(ota_md5_bytes)
|
BIN
tools/asr5501/image_gen_header
Executable file
BIN
tools/asr5501/image_gen_header
Executable file
Binary file not shown.
18
tools/asr5501/ota.py
Normal file
18
tools/asr5501/ota.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
import os
|
||||
import sys
|
||||
import struct
|
||||
import shutil
|
||||
|
||||
workdir = os.path.dirname(os.path.abspath(sys.argv[0]))
|
||||
if sys.platform == 'linux2':
|
||||
xzpath = 'xz'
|
||||
else:
|
||||
xzpath = os.path.join(workdir, 'xz', 'osx/xz' if sys.platform == 'darwin' else 'win/xz.exe').replace('\\', '/')
|
||||
|
||||
rawfile = sys.argv[1]
|
||||
rawsize = os.path.getsize(rawfile)
|
||||
xzfile = rawfile.replace('.bin', '.bin.xz')
|
||||
otafile = rawfile.replace('.bin', '.ota.bin')
|
||||
os.system('%s --lzma2=dict=32KiB --check=crc32 -k %s' % (xzpath, rawfile))
|
||||
open(xzfile, 'ab').write(struct.pack('<L', rawsize))
|
||||
shutil.move(xzfile, otafile)
|
Loading…
Add table
Add a link
Reference in a new issue