mirror of
https://github.com/elseif/MikroTikPatch
synced 2026-07-17 18:49:41 +00:00
modified: patch.py
This commit is contained in:
parent
af97ad2a07
commit
4cdd6d5619
7
patch.py
7
patch.py
@ -284,14 +284,15 @@ def patch_kernel(data:bytes,key_dict):
|
|||||||
def patch_loader(loader_file):
|
def patch_loader(loader_file):
|
||||||
try:
|
try:
|
||||||
from package import check_install_package
|
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
|
from loader.patch_loader import patch_loader as do_patch_loader
|
||||||
arch = os.getenv('ARCH','x86')
|
arch = os.getenv('ARCH','x86')
|
||||||
if arch != 'x86':
|
if arch != 'x86':
|
||||||
arch = arch.replace('-','')
|
arch = arch.replace('-','')
|
||||||
do_patch_loader(loader_file,loader_file,arch)
|
do_patch_loader(loader_file,loader_file,arch)
|
||||||
except ImportError:
|
except ImportError as e:
|
||||||
print("loader module not found. cannot run patch_loader.py")
|
print(e)
|
||||||
|
print("loader module import failed. cannot run patch_loader.py")
|
||||||
|
|
||||||
def patch_squashfs(path,key_dict):
|
def patch_squashfs(path,key_dict):
|
||||||
for root, dirs, files in os.walk(path):
|
for root, dirs, files in os.walk(path):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user