From 9b2584170edfb74ebd2e5d7d73b0b5b507964ec3 Mon Sep 17 00:00:00 2001 From: Yi-Yo Chiang Date: Tue, 4 Jan 2022 00:05:11 +0800 Subject: [PATCH] Unconditionally copy the system build.prop into target_files archive releasetools preconditions requires build metadata defined in SYSTEM/build.prop even when building a system.img-less product. Copy the SYSTEM/build.prop into the build artifact archive whenever possible to make add_img_to_target_files happy. Bug: 212486689 Bug: 213028932 Test: Dist build a system.img-less product. Product properties are read from SYSTEM/build.prop and no build error occurred. Change-Id: I2ce7f8b8ae981eaf06e2d8d2485b55b4e975caa9 --- core/Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/Makefile b/core/Makefile index 4c1ae514cc..53389d73dc 100644 --- a/core/Makefile +++ b/core/Makefile @@ -4949,6 +4949,10 @@ endef # image. ifdef BUILDING_SYSTEM_IMAGE $(BUILT_TARGET_FILES_PACKAGE): $(FULL_SYSTEMIMAGE_DEPS) +else + # releasetools may need the system build.prop even when building a + # system-image-less product. + $(BUILT_TARGET_FILES_PACKAGE): $(INSTALLED_BUILD_PROP_TARGET) endif ifdef BUILDING_USERDATA_IMAGE @@ -5195,6 +5199,12 @@ ifdef BUILDING_SYSTEM_IMAGE @# Contents of the system image $(hide) $(call package_files-copy-root, \ $(SYSTEMIMAGE_SOURCE_DIR),$(zip_root)/SYSTEM) +else ifdef INSTALLED_BUILD_PROP_TARGET + @# Copy the system build.prop even if not building a system image + @# because add_img_to_target_files may need it to build other partition + @# images. + $(hide) mkdir -p "$(zip_root)/SYSTEM" + $(hide) cp "$(INSTALLED_BUILD_PROP_TARGET)" "$(patsubst $(TARGET_OUT)/%,$(zip_root)/SYSTEM/%,$(INSTALLED_BUILD_PROP_TARGET))" endif ifdef BUILDING_USERDATA_IMAGE @# Contents of the data image