add dtbo support for ota
Test: make dist and locally push ota on a device Change-Id: I920b98f20e248b437955b2a963eb69ed2ddb8d45
This commit is contained in:
@@ -2273,6 +2273,10 @@ endif
|
|||||||
ifdef BOARD_PREBUILT_VENDORIMAGE
|
ifdef BOARD_PREBUILT_VENDORIMAGE
|
||||||
$(hide) mkdir -p $(zip_root)/IMAGES
|
$(hide) mkdir -p $(zip_root)/IMAGES
|
||||||
$(hide) cp $(INSTALLED_VENDORIMAGE_TARGET) $(zip_root)/IMAGES/
|
$(hide) cp $(INSTALLED_VENDORIMAGE_TARGET) $(zip_root)/IMAGES/
|
||||||
|
endif
|
||||||
|
ifdef BOARD_PREBUILT_DTBOIMAGE
|
||||||
|
$(hide) mkdir -p $(zip_root)/IMAGES
|
||||||
|
$(hide) cp $(INSTALLED_DTBOIMAGE_TARGET) $(zip_root)/IMAGES/
|
||||||
endif
|
endif
|
||||||
@# Run fs_config on all the system, vendor, boot ramdisk,
|
@# Run fs_config on all the system, vendor, boot ramdisk,
|
||||||
@# and recovery ramdisk files in the zip, and save the output
|
@# and recovery ramdisk files in the zip, and save the output
|
||||||
|
@@ -166,6 +166,13 @@ def AddVendor(output_zip, prefix="IMAGES/"):
|
|||||||
block_list=block_list)
|
block_list=block_list)
|
||||||
return img.name
|
return img.name
|
||||||
|
|
||||||
|
def FindDtboPrebuilt(prefix="IMAGES/"):
|
||||||
|
"""Find the prebuilt image of DTBO partition."""
|
||||||
|
|
||||||
|
prebuilt_path = os.path.join(OPTIONS.input_tmp, prefix, "dtbo.img")
|
||||||
|
if os.path.exists(prebuilt_path):
|
||||||
|
return prebuilt_path
|
||||||
|
return None
|
||||||
|
|
||||||
def CreateImage(input_dir, info_dict, what, output_file, block_list=None):
|
def CreateImage(input_dir, info_dict, what, output_file, block_list=None):
|
||||||
print("creating " + what + ".img...")
|
print("creating " + what + ".img...")
|
||||||
@@ -286,7 +293,7 @@ def AddUserdata(output_zip, prefix="IMAGES/"):
|
|||||||
|
|
||||||
|
|
||||||
def AddVBMeta(output_zip, boot_img_path, system_img_path, vendor_img_path,
|
def AddVBMeta(output_zip, boot_img_path, system_img_path, vendor_img_path,
|
||||||
prefix="IMAGES/"):
|
dtbo_img_path, prefix="IMAGES/"):
|
||||||
"""Create a VBMeta image and store it in output_zip."""
|
"""Create a VBMeta image and store it in output_zip."""
|
||||||
img = OutputFile(output_zip, OPTIONS.input_tmp, prefix, "vbmeta.img")
|
img = OutputFile(output_zip, OPTIONS.input_tmp, prefix, "vbmeta.img")
|
||||||
avbtool = os.getenv('AVBTOOL') or "avbtool"
|
avbtool = os.getenv('AVBTOOL') or "avbtool"
|
||||||
@@ -296,6 +303,8 @@ def AddVBMeta(output_zip, boot_img_path, system_img_path, vendor_img_path,
|
|||||||
"--include_descriptors_from_image", system_img_path]
|
"--include_descriptors_from_image", system_img_path]
|
||||||
if vendor_img_path is not None:
|
if vendor_img_path is not None:
|
||||||
cmd.extend(["--include_descriptors_from_image", vendor_img_path])
|
cmd.extend(["--include_descriptors_from_image", vendor_img_path])
|
||||||
|
if dtbo_img_path is not None:
|
||||||
|
cmd.extend(["--include_descriptors_from_image", dtbo_img_path])
|
||||||
if OPTIONS.info_dict.get("system_root_image", None) == "true":
|
if OPTIONS.info_dict.get("system_root_image", None) == "true":
|
||||||
cmd.extend(["--setup_rootfs_from_kernel", system_img_path])
|
cmd.extend(["--setup_rootfs_from_kernel", system_img_path])
|
||||||
common.AppendAVBSigningArgs(cmd)
|
common.AppendAVBSigningArgs(cmd)
|
||||||
@@ -481,7 +490,9 @@ def AddImagesToTargetFiles(filename):
|
|||||||
if OPTIONS.info_dict.get("board_avb_enable", None) == "true":
|
if OPTIONS.info_dict.get("board_avb_enable", None) == "true":
|
||||||
banner("vbmeta")
|
banner("vbmeta")
|
||||||
boot_contents = boot_image.WriteToTemp()
|
boot_contents = boot_image.WriteToTemp()
|
||||||
AddVBMeta(output_zip, boot_contents.name, system_img_path, vendor_img_path)
|
dtbo_img_path = FindDtboPrebuilt()
|
||||||
|
AddVBMeta(output_zip, boot_contents.name, system_img_path,
|
||||||
|
vendor_img_path, dtbo_img_path)
|
||||||
|
|
||||||
# For devices using A/B update, copy over images from RADIO/ and/or
|
# For devices using A/B update, copy over images from RADIO/ and/or
|
||||||
# VENDOR_IMAGES/ to IMAGES/ and make sure we have all the needed
|
# VENDOR_IMAGES/ to IMAGES/ and make sure we have all the needed
|
||||||
|
Reference in New Issue
Block a user