mirror of
https://huihui.cat/mirrors/MikroTikPatch.git
synced 2025-12-10 03:24:37 +01:00
modified: patch.py
This commit is contained in:
parent
d1c7aed294
commit
3811e39409
1 changed files with 5 additions and 1 deletions
6
patch.py
6
patch.py
|
|
@ -28,7 +28,11 @@ def patch_bzimage(data:bytes,key_dict:dict):
|
||||||
new_vmlinux = vmlinux.replace(initramfs,new_initramfs)
|
new_vmlinux = vmlinux.replace(initramfs,new_initramfs)
|
||||||
new_vmlinux_xz = lzma.compress(new_vmlinux,check=lzma.CHECK_CRC32,filters=[
|
new_vmlinux_xz = lzma.compress(new_vmlinux,check=lzma.CHECK_CRC32,filters=[
|
||||||
{"id": lzma.FILTER_X86},
|
{"id": lzma.FILTER_X86},
|
||||||
{"id": lzma.FILTER_LZMA2, "preset": 8,'dict_size': 32*1024*1024},
|
{"id": lzma.FILTER_LZMA2,
|
||||||
|
"preset": 9 | lzma.PRESET_EXTREME,
|
||||||
|
'dict_size': 32*1024*1024,
|
||||||
|
"lc": 4,"lp": 0, "pb": 0,
|
||||||
|
},
|
||||||
])
|
])
|
||||||
new_payload_length = len(new_vmlinux_xz)
|
new_payload_length = len(new_vmlinux_xz)
|
||||||
assert new_payload_length <= payload_length , 'new vmlinux.xz size is too big'
|
assert new_payload_length <= payload_length , 'new vmlinux.xz size is too big'
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue