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
af97ad2a07
commit
4cdd6d5619
1 changed files with 4 additions and 3 deletions
7
patch.py
7
patch.py
|
|
@ -284,14 +284,15 @@ def patch_kernel(data:bytes,key_dict):
|
|||
def patch_loader(loader_file):
|
||||
try:
|
||||
from package import check_install_package
|
||||
check_install_package(['elftools'])
|
||||
check_install_package(['pyelftools'])
|
||||
from loader.patch_loader import patch_loader as do_patch_loader
|
||||
arch = os.getenv('ARCH','x86')
|
||||
if arch != 'x86':
|
||||
arch = arch.replace('-','')
|
||||
do_patch_loader(loader_file,loader_file,arch)
|
||||
except ImportError:
|
||||
print("loader module not found. cannot run patch_loader.py")
|
||||
except ImportError as e:
|
||||
print(e)
|
||||
print("loader module import failed. cannot run patch_loader.py")
|
||||
|
||||
def patch_squashfs(path,key_dict):
|
||||
for root, dirs, files in os.walk(path):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue