Support generating partial OTAs from extracted target_files

This allows the build system to potentially paralleize generation of OTA
package and zipping of target files

Bug: 262185376
Bug: 227848550
Change-Id: I90b6c25761683ebe3803b22fc8e23540a5282c66
This commit is contained in:
Kelvin Zhang
2023-05-02 15:48:16 -07:00
parent f9f3c569d0
commit 6b10e15acc
3 changed files with 135 additions and 106 deletions

View File

@@ -1047,10 +1047,15 @@ def Fnmatch(filename, pattersn):
def CopyTargetFilesDir(input_dir):
output_dir = common.MakeTempDir("target_files")
shutil.copytree(os.path.join(input_dir, "IMAGES"), os.path.join(
output_dir, "IMAGES"), dirs_exist_ok=True)
IMAGES_DIR = ["IMAGES", "PREBUILT_IMAGES", "RADIO"]
for subdir in IMAGES_DIR:
if not os.path.exists(os.path.join(input_dir, subdir)):
continue
shutil.copytree(os.path.join(input_dir, subdir), os.path.join(
output_dir, subdir), dirs_exist_ok=True, copy_function=os.link)
shutil.copytree(os.path.join(input_dir, "META"), os.path.join(
output_dir, "META"), dirs_exist_ok=True)
for (dirpath, _, filenames) in os.walk(input_dir):
for filename in filenames:
path = os.path.join(dirpath, filename)