Merge "Clean up vendor image handling"

This commit is contained in:
Dan Willemsen 2016-06-21 21:54:40 +00:00 committed by Gerrit Code Review
commit 4f807026e2
2 changed files with 23 additions and 3 deletions

View File

@ -1124,7 +1124,7 @@ systemimage_intermediates := \
BUILT_SYSTEMIMAGE := $(systemimage_intermediates)/system.img BUILT_SYSTEMIMAGE := $(systemimage_intermediates)/system.img
# Create symlink /system/vendor to /vendor if necessary. # Create symlink /system/vendor to /vendor if necessary.
ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE ifdef BOARD_USES_VENDORIMAGE
define create-system-vendor-symlink define create-system-vendor-symlink
$(hide) if [ -d $(TARGET_OUT)/vendor ] && [ ! -h $(TARGET_OUT)/vendor ]; then \ $(hide) if [ -d $(TARGET_OUT)/vendor ] && [ ! -h $(TARGET_OUT)/vendor ]; then \
echo 'Non-symlink $(TARGET_OUT)/vendor detected!' 1>&2; \ 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) vendorimage-nodeps: | $(INTERNAL_USERIMAGES_DEPS)
$(build-vendorimage-target) $(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 # bring in the installer image generation defines if necessary
@ -1901,6 +1904,10 @@ endif
ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true) ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true)
@# If breakpad symbols have been generated, add them to the zip. @# If breakpad symbols have been generated, add them to the zip.
$(hide) $(ACP) -r $(TARGET_OUT_BREAKPAD) $(zip_root)/BREAKPAD $(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 endif
@# Zip everything up, preserving symlinks and placing META/ files first to @# Zip everything up, preserving symlinks and placing META/ files first to
@# help early validation of the .zip file while uploading it. @# help early validation of the .zip file while uploading it.
@ -1920,7 +1927,7 @@ ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
endif endif
$(hide) (cd $(zip_root) && zip -qX ../$(notdir $@) META/*filesystem_config.txt) $(hide) (cd $(zip_root) && zip -qX ../$(notdir $@) META/*filesystem_config.txt)
$(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \ $(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 .PHONY: target-files-package
target-files-package: $(BUILT_TARGET_FILES_PACKAGE) target-files-package: $(BUILT_TARGET_FILES_PACKAGE)

View File

@ -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)'.) $(error TARGET_COPY_OUT_VENDOR must be either 'vendor' or 'system/vendor', seeing '$(TARGET_COPY_OUT_VENDOR)'.)
endif endif
PRODUCT_COPY_FILES := $(subst $(_vendor_path_placeholder),$(TARGET_COPY_OUT_VENDOR),$(PRODUCT_COPY_FILES)) 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
########################################### ###########################################