From 2427d9d40243d505295e8e8c5859e46a6ceb0c13 Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Mon, 9 Sep 2024 10:31:45 -0700 Subject: [PATCH] Fix missing dir error for certain targets Test: th Bug: 364967828 Change-Id: I31f76533c3e3be63aa55f96be8fd697c4a629e65 --- tools/releasetools/add_img_to_target_files.py | 1 + tools/releasetools/sign_target_files_apks.py | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py index b39a82cf45..c25ff2718c 100644 --- a/tools/releasetools/add_img_to_target_files.py +++ b/tools/releasetools/add_img_to_target_files.py @@ -464,6 +464,7 @@ def AddDtbo(output_zip): dtbo_prebuilt_path = os.path.join( OPTIONS.input_tmp, "PREBUILT_IMAGES", "dtbo.img") assert os.path.exists(dtbo_prebuilt_path) + os.makedirs(os.path.dirname(img.name), exist_ok=True) shutil.copy(dtbo_prebuilt_path, img.name) # AVB-sign the image as needed. diff --git a/tools/releasetools/sign_target_files_apks.py b/tools/releasetools/sign_target_files_apks.py index 8e89c872d7..a72342f2d7 100755 --- a/tools/releasetools/sign_target_files_apks.py +++ b/tools/releasetools/sign_target_files_apks.py @@ -591,6 +591,7 @@ def RegenerateKernelPartitions(input_tf_zip: zipfile.ZipFile, output_tf_zip: zip else: common.UnzipToDir(input_tf_zip.filename, OPTIONS.input_tmp, files_to_unzip) unzip_dir = OPTIONS.input_tmp + os.makedirs(os.path.join(unzip_dir, "IMAGES"), exist_ok=True) boot_image = common.GetBootableImage( "IMAGES/boot.img", "boot.img", unzip_dir, "BOOT", misc_info)