Expose GetRamdiskFormat and use in ota_utils.py
Some OTA files may have additional OTA props; when this is being computed within ota_utils.py -> ComputeRuntimeBuildInfos, the ramdisk type needs to be passed into PartitionBuildProps.FromInputFile as not all ramdisk may still use gzip. This check is already defined in common.py, so this change also exposes the function GetRamdiskFormat. Bug: 231075507 Signed-off-by: TJ Rhoades <tjr@microsoft.com> Change-Id: If1b93b887990f0d90df2c6003122821c1e66a1ac
This commit is contained in:
@@ -22,7 +22,8 @@ import zipfile
|
||||
import ota_metadata_pb2
|
||||
from common import (ZipDelete, ZipClose, OPTIONS, MakeTempFile,
|
||||
ZipWriteStr, BuildInfo, LoadDictionaryFromFile,
|
||||
SignFile, PARTITIONS_WITH_BUILD_PROP, PartitionBuildProps)
|
||||
SignFile, PARTITIONS_WITH_BUILD_PROP, PartitionBuildProps,
|
||||
GetRamdiskFormat)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -371,15 +372,18 @@ def ComputeRuntimeBuildInfos(default_build_info, boot_variable_values):
|
||||
for partition in PARTITIONS_WITH_BUILD_PROP:
|
||||
partition_prop_key = "{}.build.prop".format(partition)
|
||||
input_file = info_dict[partition_prop_key].input_file
|
||||
ramdisk = GetRamdiskFormat(info_dict)
|
||||
if isinstance(input_file, zipfile.ZipFile):
|
||||
with zipfile.ZipFile(input_file.filename, allowZip64=True) as input_zip:
|
||||
info_dict[partition_prop_key] = \
|
||||
PartitionBuildProps.FromInputFile(input_zip, partition,
|
||||
placeholder_values)
|
||||
placeholder_values,
|
||||
ramdisk)
|
||||
else:
|
||||
info_dict[partition_prop_key] = \
|
||||
PartitionBuildProps.FromInputFile(input_file, partition,
|
||||
placeholder_values)
|
||||
placeholder_values,
|
||||
ramdisk)
|
||||
info_dict["build.prop"] = info_dict["system.build.prop"]
|
||||
build_info_set.add(BuildInfo(info_dict, default_build_info.oem_dicts))
|
||||
|
||||
|
Reference in New Issue
Block a user