mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-29 21:56:35 +00:00
Merge pull request #9820 from Jason2866/patch-3
firmware compressed size info
This commit is contained in:
commit
6d37ace1c9
@ -19,5 +19,10 @@ def bin_gzip(source, target, env):
|
|||||||
with open(bin_file,"rb") as fp:
|
with open(bin_file,"rb") as fp:
|
||||||
with gzip.open(gzip_file, "wb", compresslevel = 9) as f:
|
with gzip.open(gzip_file, "wb", compresslevel = 9) as f:
|
||||||
shutil.copyfileobj(fp, f)
|
shutil.copyfileobj(fp, f)
|
||||||
|
|
||||||
|
ORG_FIRMWARE_SIZE = os.stat(bin_file).st_size
|
||||||
|
GZ_FIRMWARE_SIZE = os.stat(gzip_file).st_size
|
||||||
|
|
||||||
|
print("Compression reduced firmware size by {:.0f}% (was {} bytes, now {} bytes)".format((GZ_FIRMWARE_SIZE / ORG_FIRMWARE_SIZE) * 100, ORG_FIRMWARE_SIZE, GZ_FIRMWARE_SIZE))
|
||||||
|
|
||||||
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_gzip])
|
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_gzip])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user