Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f87ea90d authored by Tao Bao's avatar Tao Bao Committed by android-build-merger
Browse files

Merge "releasetools: Rename the ramdisk_dir in prop dict to root_dir."

am: d0947139

Change-Id: I013c82846a143c5eac050325e66092afc66c958f
parents 14f90c40 d0947139
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1285,7 +1285,7 @@ $(if $(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)),\
    $(hide) echo "recovery_as_boot=true" >> $(1))
$(if $(filter true,$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)),\
    $(hide) echo "system_root_image=true" >> $(1)
    $(hide) echo "ramdisk_dir=$(TARGET_ROOT_OUT)" >> $(1))
    $(hide) echo "root_dir=$(TARGET_ROOT_OUT)" >> $(1))
$(if $(USE_LOGICAL_PARTITIONS),$(hide) echo "use_logical_partitions=true" >> $(1))
$(if $(3),$(hide) $(foreach kv,$(3),echo "$(kv)" >> $(1);))
endef
+10 −10
Original line number Diff line number Diff line
@@ -483,7 +483,7 @@ def BuildImage(in_dir, prop_dict, out_file, target_out=None):
    True iff the image is built successfully.
  """
  # system_root_image=true: build a system.img that combines the contents of
  # /system and the ramdisk, and can be mounted at the root of the file system.
  # /system and root, which should be mounted at the root of the file system.
  origin_in = in_dir
  fs_config = prop_dict.get("fs_config")
  if (prop_dict.get("system_root_image") == "true" and
@@ -492,12 +492,12 @@ def BuildImage(in_dir, prop_dict, out_file, target_out=None):
    # Change the mount point to "/".
    prop_dict["mount_point"] = "/"
    if fs_config:
      # We need to merge the fs_config files of system and ramdisk.
      merged_fs_config = common.MakeTempFile(prefix="root_fs_config",
      # We need to merge the fs_config files of system and root.
      merged_fs_config = common.MakeTempFile(prefix="merged_fs_config",
                                             suffix=".txt")
      with open(merged_fs_config, "w") as fw:
        if "ramdisk_fs_config" in prop_dict:
          with open(prop_dict["ramdisk_fs_config"]) as fr:
        if "root_fs_config" in prop_dict:
          with open(prop_dict["root_fs_config"]) as fr:
            fw.writelines(fr.readlines())
        with open(fs_config) as fr:
          fw.writelines(fr.readlines())
@@ -645,10 +645,10 @@ def BuildImage(in_dir, prop_dict, out_file, target_out=None):

  if in_dir != origin_in:
    # Construct a staging directory of the root file system.
    ramdisk_dir = prop_dict.get("ramdisk_dir")
    if ramdisk_dir:
    root_dir = prop_dict.get("root_dir")
    if root_dir:
      shutil.rmtree(in_dir)
      shutil.copytree(ramdisk_dir, in_dir, symlinks=True)
      shutil.copytree(root_dir, in_dir, symlinks=True)
    staging_system = os.path.join(in_dir, "system")
    shutil.rmtree(staging_system, ignore_errors=True)
    shutil.copytree(origin_in, staging_system, symlinks=True)
@@ -790,8 +790,8 @@ def ImagePropFromGlobalDict(glob_dict, mount_point):
      d["journal_size"] = "0"
    copy_prop("system_verity_block_device", "verity_block_device")
    copy_prop("system_root_image", "system_root_image")
    copy_prop("ramdisk_dir", "ramdisk_dir")
    copy_prop("ramdisk_fs_config", "ramdisk_fs_config")
    copy_prop("root_dir", "root_dir")
    copy_prop("root_fs_config", "root_fs_config")
    copy_prop("ext4_share_dup_blocks", "ext4_share_dup_blocks")
    copy_prop("system_squashfs_compressor", "squashfs_compressor")
    copy_prop("system_squashfs_compressor_opt", "squashfs_compressor_opt")
+3 −3
Original line number Diff line number Diff line
@@ -196,10 +196,10 @@ def LoadInfoDict(input_file, input_dir=None):
    if fc_config:
      d["selinux_fc"] = fc_config

    # Similarly we need to redirect "ramdisk_dir" and "ramdisk_fs_config".
    # Similarly we need to redirect "root_dir" and "root_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(
      d["root_dir"] = os.path.join(input_dir, "ROOT")
      d["root_fs_config"] = os.path.join(
          input_dir, "META", "root_filesystem_config.txt")

    # Redirect {system,vendor}_base_fs_file.