pmb.parse.bootimg: Add preliminary support for header v2 (MR 2194)

This includes setting header_version="2" as well as dtb_offset
according to the input boot.img when header v2 is detected.

Also adds the following previously missed deviceinfo_attributes:

* "header_version"
* "bootimg_custom_args"

And fixes failing tests now that header_version is always parsed from
boot.img files.
This commit is contained in:
Jami Kettunen 2022-07-15 17:10:04 +03:00 committed by Clayton Craft
parent c36e4a43ac
commit 255e69be5e
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A
4 changed files with 21 additions and 8 deletions

View file

@ -43,7 +43,8 @@ def test_bootimg_invalid_file(args):
def test_bootimg_normal(args):
path = pmb_test.const.testdata + "/bootimg/normal-boot.img"
output = {"base": "0x80000000",
output = {"header_version": "0",
"base": "0x80000000",
"kernel_offset": "0x00008000",
"ramdisk_offset": "0x04000000",
"second_offset": "0x00f00000",
@ -73,7 +74,8 @@ def test_bootimg_qcdt(args):
def test_bootimg_mtk_mkimage(args):
path = pmb_test.const.testdata + "/bootimg/mtk_mkimage-boot.img"
output = {"base": "0x10000000",
output = {"header_version": "0",
"base": "0x10000000",
"kernel_offset": "0x00008000",
"ramdisk_offset": "0x01000000",
"second_offset": "0x00f00000",
@ -88,7 +90,8 @@ def test_bootimg_mtk_mkimage(args):
def test_bootimg_mtk_mkimage_recovery(args):
path = pmb_test.const.testdata + "/bootimg/mtk_mkimage-boot-recovery.img"
output = {"base": "0x80000000",
output = {"header_version": "0",
"base": "0x80000000",
"kernel_offset": "0x00008000",
"ramdisk_offset": "0x04000000",
"second_offset": "0x00f00000",
@ -103,7 +106,8 @@ def test_bootimg_mtk_mkimage_recovery(args):
def test_bootimg_dtb_second(args):
path = pmb_test.const.testdata + "/bootimg/dtb-second-boot.img"
output = {"base": "0x00000000",
output = {"header_version": "0",
"base": "0x00000000",
"kernel_offset": "0x00008000",
"ramdisk_offset": "0x02000000",
"second_offset": "0x00f00000",