Hi,
I'm attempting to patch an OTA Update ZIP file, and with a KernelSU boot img, and I'm getting the below error:
File "C:\tools\avbroot\avbroot\boot.py", line 371, in patch raise ValueError('The prepatched boot image is not compatible ' ValueError: The prepatched boot image is not compatible with the original: - Kernel module interface version changed: 5.10-android13-4 -> None
I'm using the below command:
python avbroot\avbroot.py patch --input ota.zip --privkey-avb avb.key --privkey-ota ota.key --cert-ota ota.crt --prepatched kernelsu.img --boot-partition @gki_kernel
There's a chance that I'm using an updated KernelSU image than one flashed to my device initially during the "Initial Setup", however, I believe that should be unrelated. Do I need to extract the update, and change something, before doing the step-5 in https://github.com/chenxiaolong/avbroot#usage ?
Full Error:
C:\tools>python avbroot\avbroot.py patch --input ota.zip --privkey-avb avb.key --privkey-ota ota.key --cert-ota ota.crt --prepatched kernelsu.img --boot-partition @gki_kernel
Passphrase for avb.key:
Passphrase for ota.key:
***** Copying apex_info.pb *****
***** Copying care_map.pb *****
***** Patching payload.bin *****
***** Extracting boot, vbmeta, vbmeta_system, vbmeta_vendor, vendor_boot from the payload *****
***** Patching boot, vendor_boot *****
Traceback (most recent call last):
File "C:\tools\avbroot\avbroot\main.py", line 196, in patch_ota_payload
future.result()
File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\concurrent\futures_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\concurrent\futures_base.py", line 401, in __get_result
raise self._exception
File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\concurrent\futures\thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\tools\avbroot\avbroot\main.py", line 180, in apply_patches
boot.patch_boot(
File "C:\tools\avbroot\avbroot\boot.py", line 444, in patch_boot
patch_func(f.name)
File "C:\tools\avbroot\avbroot\boot.py", line 39, in call
boot_image = self.patch(image_file, boot_image)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\tools\avbroot\avbroot\boot.py", line 371, in patch
raise ValueError('The prepatched boot image is not compatible '
ValueError: The prepatched boot image is not compatible with the original:
- Kernel module interface version changed: 5.10-android13-4 -> None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 620, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\user\AppData\Local\Temp\tmpj_zczwus\extract\boot.img'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\tempfile.py", line 878, in onerror
_os.unlink(path)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\user\AppData\Local\Temp\tmpj_zczwus\extract\boot.img'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\tools\avbroot\avbroot.py", line 6, in
main.main()
File "C:\tools\avbroot\avbroot\main.py", line 725, in main
patch_subcommand(args)
File "C:\tools\avbroot\avbroot\main.py", line 474, in patch_subcommand
metadata = patch_ota_zip(args.input, temp, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\tools\avbroot\avbroot\main.py", line 375, in patch_ota_zip
properties = patch_ota_payload(
^^^^^^^^^^^^^^^^^^
File "C:\tools\avbroot\avbroot\main.py", line 128, in patch_ota_payload
with tempfile.TemporaryDirectory() as temp_dir:
File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\tempfile.py", line 904, in exit
self.cleanup()
File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\tempfile.py", line 908, in cleanup
self._rmtree(self.name, ignore_errors=self._ignore_cleanup_errors)
File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\tempfile.py", line 890, in _rmtree
_shutil.rmtree(name, onerror=onerror)
File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 759, in rmtree
return _rmtree_unsafe(path, onerror)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 617, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 622, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\tempfile.py", line 881, in onerror
cls._rmtree(path, ignore_errors=ignore_errors)
File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\tempfile.py", line 890, in _rmtree
_shutil.rmtree(name, onerror=onerror)
File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 759, in rmtree
return _rmtree_unsafe(path, onerror)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 603, in _rmtree_unsafe
onerror(os.scandir, path, sys.exc_info())
File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 600, in _rmtree_unsafe
with os.scandir(path) as scandir_it:
^^^^^^^^^^^^^^^^
NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\Users\user\AppData\Local\Temp\tmpj_zczwus\extract\boot.img'
C:\tools>
Thank you!