From c63a2b36d74dadb51a9cdcc71ad470111ebe3f02 Mon Sep 17 00:00:00 2001 From: Jiakai Zhang Date: Mon, 12 Jun 2023 11:18:12 +0100 Subject: [PATCH] Avoid using soong_zip's "-e" flag for boot.zip. aosp/23658853 changes boot.zip, which need to be cherry-picked to UDC. It uses soong_zip's "-e" flag to specify the filename to use in boot.zip for METADATA.txt. However, the "-e" flag doesn't exist on UDC. This change uses an alternative approach to avoid using the "-e" flag. Before this change, the contents were written to out/dist/boot.zip.METADATA.txt and then passed to soong_zip with "-e" to rename to file to "METADATA.txt". After this change, the contents are written to out/dist/boot_zip/METADATA.txt and then passed to soong_zip with "-j" to remove the directory name. Bug: 286381070 Test: m dist out/dist/boot.zip (on udc-dev) (cherry picked from https://android-review.googlesource.com/q/commit:34914f620bcc0339104ef0360f6a30492f407409) Merged-In: I769de5194b5716f05e5352f4efd635a70ba0b891 Change-Id: I769de5194b5716f05e5352f4efd635a70ba0b891 --- core/dex_preopt.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk index af5ff9d686..86ca7299b6 100644 --- a/core/dex_preopt.mk +++ b/core/dex_preopt.mk @@ -95,7 +95,7 @@ booclasspath_locations_arg := $(subst $(space),:,$(DEXPREOPT_BOOTCLASSPATH_DEX_L boot_images := $(subst :,$(space),$(DEXPREOPT_IMAGE_LOCATIONS_ON_DEVICE$(DEXPREOPT_INFIX))) boot_image_arg := $(subst $(space),:,$(patsubst /%,%,$(boot_images))) -boot_zip_metadata_txt := $(boot_zip).METADATA.txt +boot_zip_metadata_txt := $(dir $(boot_zip))boot_zip/METADATA.txt $(boot_zip_metadata_txt): rm -f $@ echo "booclasspath = $(booclasspath_arg)" >> $@ @@ -112,7 +112,7 @@ $(boot_zip): $(bootclasspath_jars) $(system_server_jars) $(SOONG_ZIP) $(MERGE_ZI $(SOONG_ZIP) -o $@.tmp \ -C $(dir $(firstword $(PRIVATE_BOOTCLASSPATH_JARS)))/.. $(addprefix -f ,$(PRIVATE_BOOTCLASSPATH_JARS)) \ -C $(PRODUCT_OUT) $(addprefix -f ,$(PRIVATE_SYSTEM_SERVER_JARS)) \ - -e METADATA.txt -f $(boot_zip_metadata_txt) + -j -f $(boot_zip_metadata_txt) $(MERGE_ZIPS) $@ $@.tmp $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art) $(DEXPREOPT_IMAGE_ZIP_mainline) rm -f $@.tmp