Merge "Override properties that point to out/ directory."
This commit is contained in:
@@ -135,10 +135,6 @@ def CreateImage(input_dir, info_dict, what, block_list=None):
|
|||||||
image_props["fs_config"] = fs_config
|
image_props["fs_config"] = fs_config
|
||||||
if block_list:
|
if block_list:
|
||||||
image_props["block_list"] = block_list
|
image_props["block_list"] = block_list
|
||||||
if image_props.get("system_root_image") == "true":
|
|
||||||
image_props["ramdisk_dir"] = os.path.join(input_dir, "BOOT/RAMDISK")
|
|
||||||
image_props["ramdisk_fs_config"] = os.path.join(
|
|
||||||
input_dir, "META/boot_filesystem_config.txt")
|
|
||||||
|
|
||||||
succ = build_image.BuildImage(os.path.join(input_dir, what),
|
succ = build_image.BuildImage(os.path.join(input_dir, what),
|
||||||
image_props, img)
|
image_props, img)
|
||||||
|
@@ -413,6 +413,7 @@ def ImagePropFromGlobalDict(glob_dict, mount_point):
|
|||||||
copy_prop("system_verity_block_device", "verity_block_device")
|
copy_prop("system_verity_block_device", "verity_block_device")
|
||||||
copy_prop("system_root_image", "system_root_image")
|
copy_prop("system_root_image", "system_root_image")
|
||||||
copy_prop("ramdisk_dir", "ramdisk_dir")
|
copy_prop("ramdisk_dir", "ramdisk_dir")
|
||||||
|
copy_prop("ramdisk_fs_config", "ramdisk_fs_config")
|
||||||
copy_prop("has_ext4_reserved_blocks", "has_ext4_reserved_blocks")
|
copy_prop("has_ext4_reserved_blocks", "has_ext4_reserved_blocks")
|
||||||
elif mount_point == "data":
|
elif mount_point == "data":
|
||||||
# Copy the generic fs type first, override with specific one if available.
|
# Copy the generic fs type first, override with specific one if available.
|
||||||
|
@@ -145,15 +145,20 @@ def LoadInfoDict(input_file, input_dir=None):
|
|||||||
if "fstab_version" not in d:
|
if "fstab_version" not in d:
|
||||||
d["fstab_version"] = "1"
|
d["fstab_version"] = "1"
|
||||||
|
|
||||||
# During building, we use the "file_contexts" in the out/ directory tree.
|
# A few properties are stored as links to the files in the out/ directory.
|
||||||
# It is no longer available when (re)generating from target_files zip. So
|
# It works fine with the build system. However, they are no longer available
|
||||||
# when generating from target_files zip, we look for a copy under META/
|
# when (re)generating from target_files zip. If input_dir is not None, we
|
||||||
# first, if not available search under BOOT/RAMDISK/. Note that we may need
|
# are doing repacking. Redirect those properties to the actual files in the
|
||||||
# a different file_contexts to build images than the one running on device,
|
# unzipped directory.
|
||||||
# such as when enabling system_root_image. In that case, we must have the
|
|
||||||
# one for building copied to META/.
|
|
||||||
if input_dir is not None:
|
if input_dir is not None:
|
||||||
|
# We carry a copy of file_contexts under META/. If not available, search
|
||||||
|
# BOOT/RAMDISK/. Note that sometimes we may need a different file_contexts
|
||||||
|
# to build images than the one running on device, such as when enabling
|
||||||
|
# system_root_image. In that case, we must have the one for image
|
||||||
|
# generation copied to META/.
|
||||||
fc_config = os.path.join(input_dir, "META", "file_contexts")
|
fc_config = os.path.join(input_dir, "META", "file_contexts")
|
||||||
|
if d.get("system_root_image") == "true":
|
||||||
|
assert os.path.exists(fc_config)
|
||||||
if not os.path.exists(fc_config):
|
if not os.path.exists(fc_config):
|
||||||
fc_config = os.path.join(input_dir, "BOOT", "RAMDISK", "file_contexts")
|
fc_config = os.path.join(input_dir, "BOOT", "RAMDISK", "file_contexts")
|
||||||
if not os.path.exists(fc_config):
|
if not os.path.exists(fc_config):
|
||||||
@@ -162,6 +167,12 @@ def LoadInfoDict(input_file, input_dir=None):
|
|||||||
if fc_config:
|
if fc_config:
|
||||||
d["selinux_fc"] = fc_config
|
d["selinux_fc"] = fc_config
|
||||||
|
|
||||||
|
# Similarly we need to redirect "ramdisk_dir" and "ramdisk_fs_config".
|
||||||
|
if d.get("system_root_image") == "true":
|
||||||
|
d["ramdisk_dir"] = os.path.join(input_dir, "ROOT")
|
||||||
|
d["ramdisk_fs_config"] = os.path.join(
|
||||||
|
input_dir, "META", "root_filesystem_config.txt")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
data = read_helper("META/imagesizes.txt")
|
data = read_helper("META/imagesizes.txt")
|
||||||
for line in data.split("\n"):
|
for line in data.split("\n"):
|
||||||
|
Reference in New Issue
Block a user