diff --git a/core/Makefile b/core/Makefile index 064af661c..37bad8af8 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1124,7 +1124,7 @@ systemimage_intermediates := \ BUILT_SYSTEMIMAGE := $(systemimage_intermediates)/system.img # Create symlink /system/vendor to /vendor if necessary. -ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE +ifdef BOARD_USES_VENDORIMAGE define create-system-vendor-symlink $(hide) if [ -d $(TARGET_OUT)/vendor ] && [ ! -h $(TARGET_OUT)/vendor ]; then \ echo 'Non-symlink $(TARGET_OUT)/vendor detected!' 1>&2; \ @@ -1519,7 +1519,10 @@ $(INSTALLED_VENDORIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) $(INTERNAL_VENDORIM vendorimage-nodeps: | $(INTERNAL_USERIMAGES_DEPS) $(build-vendorimage-target) -endif # BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE +else ifdef BOARD_PREBUILT_VENDORIMAGE +INSTALLED_VENDORIMAGE_TARGET := $(PRODUCT_OUT)/vendor.img +$(eval $(call copy-one-file,$(BOARD_PREBUILT_VENDORIMAGE),$(INSTALLED_VENDORIMAGE_TARGET))) +endif # ----------------------------------------------------------------- # bring in the installer image generation defines if necessary @@ -1901,6 +1904,10 @@ endif ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true) @# If breakpad symbols have been generated, add them to the zip. $(hide) $(ACP) -r $(TARGET_OUT_BREAKPAD) $(zip_root)/BREAKPAD +endif +ifdef BOARD_PREBUILT_VENDORIMAGE + $(hide) mkdir -p $(zip_root)/IMAGES + $(hide) cp $(INSTALLED_VENDORIMAGE_TARGET) $(zip_root)/IMAGES/ endif @# Zip everything up, preserving symlinks and placing META/ files first to @# help early validation of the .zip file while uploading it. @@ -1920,7 +1927,7 @@ ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),) endif $(hide) (cd $(zip_root) && zip -qX ../$(notdir $@) META/*filesystem_config.txt) $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \ - ./build/tools/releasetools/add_img_to_target_files -v -p $(HOST_OUT) $@ + ./build/tools/releasetools/add_img_to_target_files -a -v -p $(HOST_OUT) $@ .PHONY: target-files-package target-files-package: $(BUILT_TARGET_FILES_PACKAGE) diff --git a/core/envsetup.mk b/core/envsetup.mk index 0a7472af3..49ca154b1 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -173,6 +173,19 @@ else ifeq ($(filter vendor system/vendor,$(TARGET_COPY_OUT_VENDOR)),) $(error TARGET_COPY_OUT_VENDOR must be either 'vendor' or 'system/vendor', seeing '$(TARGET_COPY_OUT_VENDOR)'.) endif PRODUCT_COPY_FILES := $(subst $(_vendor_path_placeholder),$(TARGET_COPY_OUT_VENDOR),$(PRODUCT_COPY_FILES)) + +BOARD_USES_VENDORIMAGE := +ifdef BOARD_PREBUILT_VENDORIMAGE +BOARD_USES_VENDORIMAGE := true +endif +ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE +BOARD_USES_VENDORIMAGE := true +endif +ifeq ($(TARGET_COPY_OUT_VENDOR),vendor) +BOARD_USES_VENDORIMAGE := true +else ifdef BOARD_USES_VENDORIMAGE +$(error TARGET_COPY_OUT_VENDOR must be set to 'vendor' to use a vendor image) +endif ###########################################