pmb.parse.bootimg: fix kernel detection (!1846)

Adjust to new text that "file" outputs for ARM linux kernels:
	"ARM OpenFirmware FORTH Dictionary..."

Make test_bootimg_kernel pass again, which was failing with:
	AssertionError: assert 'heimdall-isorec' in 'File is not an Android ...
This commit is contained in:
Oliver Smith 2019-12-23 20:16:27 +01:00
parent efdfc33dec
commit a790900e31
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 2 additions and 1 deletions

View File

@ -55,7 +55,8 @@ def bootimg(args, path):
" boot.img file, you could force the analysis"
" with: 'pmbootstrap bootimg_analyze " + path +
" -f'")
if "linux kernel" in file_output.lower():
if ("linux kernel" in file_output.lower() or
"ARM OpenFirmware FORTH Dictionary" in file_output):
raise RuntimeError("File is a Kernel image, you might need the"
" 'heimdall-isorec' flash method. See also:"
" <https://wiki.postmarketos.org/wiki/"