modified: patch.py

This commit is contained in:
zyb 2025-06-19 13:31:48 +08:00
parent af97ad2a07
commit 4cdd6d5619

View file

@ -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):