Merge changes I1459d62f,I4c2b975e

am: bb937a6b69

Change-Id: Ifdedee1b0251bc9c2a8baf30d28b5d315b5c9e20
This commit is contained in:
Yifan Hong 2018-07-30 11:35:33 -07:00 committed by android-build-merger
commit 8883a739b3
7 changed files with 170 additions and 91 deletions

View File

@ -482,9 +482,9 @@ $(INSTALLED_PRODUCT_SERVICES_BUILD_PROP_TARGET):
@mkdir -p $(dir $@)
$(hide) echo > $@
ifdef BOARD_USES_PRODUCT_SERVICESIMAGE
$(hide) echo ro.productservices.build.date=`$(DATE_FROM_FILE)`>>$@
$(hide) echo ro.productservices.build.date.utc=`$(DATE_FROM_FILE) +%s`>>$@
$(hide) echo ro.productservices.build.fingerprint="$(BUILD_FINGERPRINT_FROM_FILE)">>$@
$(hide) echo ro.product_services.build.date=`$(DATE_FROM_FILE)`>>$@
$(hide) echo ro.product_services.build.date.utc=`$(DATE_FROM_FILE) +%s`>>$@
$(hide) echo ro.product_services.build.fingerprint="$(BUILD_FINGERPRINT_FROM_FILE)">>$@
endif # BOARD_USES_PRODUCT_SERVICESIMAGE
$(hide) echo "#" >> $@; \
echo "# ADDITIONAL PRODUCT_SERVICES PROPERTIES" >> $@; \
@ -1164,7 +1164,7 @@ endif
endif # USE_LOGICAL_PARTITIONS
# $(1): the path of the output dictionary file
# $(2): a subset of "system vendor cache userdata product productservices oem"
# $(2): a subset of "system vendor cache userdata product product_services oem"
# $(3): additional "key=value" pairs to append to the dictionary file.
define generate-image-prop-dictionary
$(if $(filter $(2),system),\
@ -1215,17 +1215,17 @@ $(if $(filter $(2),product),\
$(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_BASE_FS_PATH),$(hide) echo "product_base_fs_file=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_BASE_FS_PATH)" >> $(1))
$(if $(BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "product_reserved_size=$(BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE)" >> $(1))
)
$(if $(filter $(2),productservices),\
$(if $(BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "productservices_fs_type=$(BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_EXTFS_INODE_COUNT),$(hide) echo "productservices_extfs_inode_count=$(BOARD_PRODUCT_SERVICESIMAGE_EXTFS_INODE_COUNT)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_EXTFS_RSV_PCT),$(hide) echo "productservices_extfs_rsv_pct=$(BOARD_PRODUCT_SERVICESIMAGE_EXTFS_RSV_PCT)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_PARTITION_SIZE),$(hide) echo "productservices_size=$(BOARD_PRODUCT_SERVICESIMAGE_PARTITION_SIZE)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_JOURNAL_SIZE),$(hide) echo "productservices_journal_size=$(BOARD_PRODUCT_SERVICESIMAGE_JOURNAL_SIZE)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR),$(hide) echo "productservices_squashfs_compressor=$(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR_OPT),$(hide) echo "productservices_squashfs_compressor_opt=$(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR_OPT)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_BLOCK_SIZE),$(hide) echo "productservices_squashfs_block_size=$(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_BLOCK_SIZE)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_DISABLE_4K_ALIGN),$(hide) echo "productservices_squashfs_disable_4k_align=$(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_DISABLE_4K_ALIGN)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "productservices_reserved_size=$(BOARD_PRODUCT_SERVICESIMAGE_PARTITION_RESERVED_SIZE)" >> $(1))
$(if $(filter $(2),product_services),\
$(if $(BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "product_services_fs_type=$(BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_EXTFS_INODE_COUNT),$(hide) echo "product_services_extfs_inode_count=$(BOARD_PRODUCT_SERVICESIMAGE_EXTFS_INODE_COUNT)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_EXTFS_RSV_PCT),$(hide) echo "product_services_extfs_rsv_pct=$(BOARD_PRODUCT_SERVICESIMAGE_EXTFS_RSV_PCT)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_PARTITION_SIZE),$(hide) echo "product_services_size=$(BOARD_PRODUCT_SERVICESIMAGE_PARTITION_SIZE)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_JOURNAL_SIZE),$(hide) echo "product_services_journal_size=$(BOARD_PRODUCT_SERVICESIMAGE_JOURNAL_SIZE)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR),$(hide) echo "product_services_squashfs_compressor=$(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR_OPT),$(hide) echo "product_services_squashfs_compressor_opt=$(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_COMPRESSOR_OPT)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_BLOCK_SIZE),$(hide) echo "product_services_squashfs_block_size=$(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_BLOCK_SIZE)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_DISABLE_4K_ALIGN),$(hide) echo "product_services_squashfs_disable_4k_align=$(BOARD_PRODUCT_SERVICESIMAGE_SQUASHFS_DISABLE_4K_ALIGN)" >> $(1))
$(if $(BOARD_PRODUCT_SERVICESIMAGE_PARTITION_RESERVED_SIZE),$(hide) echo "product_services_reserved_size=$(BOARD_PRODUCT_SERVICESIMAGE_PARTITION_RESERVED_SIZE)" >> $(1))
)
$(if $(filter $(2),oem),\
$(if $(BOARD_OEMIMAGE_PARTITION_SIZE),$(hide) echo "oem_size=$(BOARD_OEMIMAGE_PARTITION_SIZE)" >> $(1))
@ -1250,7 +1250,7 @@ $(if $(filter eng, $(TARGET_BUILD_VARIANT)),$(hide) echo "verity_disable=true" >
$(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_VERITY_PARTITION),$(hide) echo "system_verity_block_device=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_VERITY_PARTITION)" >> $(1))
$(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_VERITY_PARTITION),$(hide) echo "vendor_verity_block_device=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VENDOR_VERITY_PARTITION)" >> $(1))
$(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_VERITY_PARTITION),$(hide) echo "product_verity_block_device=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_VERITY_PARTITION)" >> $(1))
$(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_SERVICES_VERITY_PARTITION),$(hide) echo "productservices_verity_block_device=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_SERVICES_VERITY_PARTITION)" >> $(1))
$(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_SERVICES_VERITY_PARTITION),$(hide) echo "product_services_verity_block_device=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PRODUCT_SERVICES_VERITY_PARTITION)" >> $(1))
$(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT),$(hide) echo "vboot=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT)" >> $(1))
$(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT),$(hide) echo "vboot_key=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VBOOT_SIGNING_KEY)" >> $(1))
$(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT),$(hide) echo "vboot_subkey=$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_VBOOT_SIGNING_SUBKEY)" >> $(1))
@ -1280,9 +1280,9 @@ $(if $(BOARD_AVB_ENABLE),\
$(hide) echo "avb_product_rollback_index_location=$(BOARD_AVB_PRODUCT_ROLLBACK_INDEX_LOCATION)" >> $(1)))
$(if $(BOARD_AVB_ENABLE),\
$(if $(BOARD_AVB_PRODUCT_SERVICES_KEY_PATH),\
$(hide) echo "avb_productservices_key_path=$(BOARD_AVB_PRODUCT_SERVICES_KEY_PATH)" >> $(1)
$(hide) echo "avb_productservices_algorithm=$(BOARD_AVB_PRODUCT_SERVICES_ALGORITHM)" >> $(1)
$(hide) echo "avb_productservices_rollback_index_location=$(BOARD_AVB_PRODUCT_SERVICES_ROLLBACK_INDEX_LOCATION)" >> $(1)))
$(hide) echo "avb_product_services_key_path=$(BOARD_AVB_PRODUCT_SERVICES_KEY_PATH)" >> $(1)
$(hide) echo "avb_product_services_algorithm=$(BOARD_AVB_PRODUCT_SERVICES_ALGORITHM)" >> $(1)
$(hide) echo "avb_product_services_rollback_index_location=$(BOARD_AVB_PRODUCT_SERVICES_ROLLBACK_INDEX_LOCATION)" >> $(1)))
$(if $(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)),\
$(hide) echo "recovery_as_boot=true" >> $(1))
$(if $(filter true,$(BOARD_BUILD_SYSTEM_ROOT_IMAGE)),\
@ -1295,7 +1295,7 @@ endef
# $(1): the path of the output dictionary file
# $(2): additional "key=value" pairs to append to the dictionary file.
define generate-userimage-prop-dictionary
$(call generate-image-prop-dictionary,$(1),system vendor cache userdata product productservices oem,$(2))
$(call generate-image-prop-dictionary,$(1),system vendor cache userdata product product_services oem,$(2))
endef
# $(1): the path of the input dictionary file, where each line has the format key=value
@ -1700,7 +1700,7 @@ endif
# Create symlink /system/product-services to /product-services if necessary.
ifdef BOARD_USES_PRODUCT_SERVICESIMAGE
define create-system-productservices-symlink
define create-system-product-services-symlink
$(hide) if [ -d $(TARGET_OUT)/product-services ] && [ ! -h $(TARGET_OUT)/product-services ]; then \
echo 'Non-symlink $(TARGET_OUT)/product-services detected!' 1>&2; \
echo 'You cannot install files to $(TARGET_OUT)/product-services while building a separate product-services.img!' 1>&2; \
@ -1709,7 +1709,7 @@ fi
$(hide) ln -sf /product-services $(TARGET_OUT)/product-services
endef
else
define create-system-productservices-symlink
define create-system-product-services-symlink
endef
endif
@ -1718,7 +1718,7 @@ define build-systemimage-target
@echo "Target system fs image: $(1)"
$(call create-system-vendor-symlink)
$(call create-system-product-symlink)
$(call create-system-productservices-symlink)
$(call create-system-product-services-symlink)
@mkdir -p $(dir $(1)) $(systemimage_intermediates) && rm -rf $(systemimage_intermediates)/system_image_info.txt
$(call generate-image-prop-dictionary, $(systemimage_intermediates)/system_image_info.txt,system, \
skip_fsck=true)
@ -1798,7 +1798,7 @@ define build-systemtarball-target
$(call pretty,"Target system fs tarball: $(INSTALLED_SYSTEMTARBALL_TARGET)")
$(call create-system-vendor-symlink)
$(call create-system-product-symlink)
$(call create-system-productservices-symlink)
$(call create-system-product-services-symlink)
$(MKTARBALL) $(FS_GET_STATS) \
$(PRODUCT_OUT) system $(PRIVATE_SYSTEM_TAR) \
$(INSTALLED_SYSTEMTARBALL_TARGET) $(TARGET_OUT)
@ -2303,7 +2303,7 @@ INTERNAL_PRODUCT_SERVICESIMAGE_FILES := \
# platform.zip depends on $(INTERNAL_PRODUCT_SERVICESIMAGE_FILES).
$(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_PRODUCT_SERVICESIMAGE_FILES)
INSTALLED_FILES_FILE_PRODUCT_SERVICES := $(PRODUCT_OUT)/installed-files-productservices.txt
INSTALLED_FILES_FILE_PRODUCT_SERVICES := $(PRODUCT_OUT)/installed-files-product-services.txt
INSTALLED_FILES_JSON_PRODUCT_SERVICES := $(INSTALLED_FILES_FILE_PRODUCT_SERVICES:.txt=.json)
$(INSTALLED_FILES_FILE_PRODUCT_SERVICES): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_PRODUCT_SERVICES)
$(INSTALLED_FILES_FILE_PRODUCT_SERVICES) : $(INTERNAL_PRODUCT_SERVICESIMAGE_FILES) $(FILESLIST)
@ -2313,31 +2313,31 @@ $(INSTALLED_FILES_FILE_PRODUCT_SERVICES) : $(INTERNAL_PRODUCT_SERVICESIMAGE_FILE
$(hide) $(FILESLIST) $(TARGET_OUT_PRODUCT_SERVICES) > $(@:.txt=.json)
$(hide) build/tools/fileslist_util.py -c $(@:.txt=.json) > $@
productservicesimage_intermediates := \
$(call intermediates-dir-for,PACKAGING,productservices)
product_servicesimage_intermediates := \
$(call intermediates-dir-for,PACKAGING,product_services)
BUILT_PRODUCT_SERVICESIMAGE_TARGET := $(PRODUCT_OUT)/product-services.img
define build-productservicesimage-target
define build-product-servicesimage-target
$(call pretty,"Target product-services fs image: $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET)")
@mkdir -p $(TARGET_OUT_PRODUCT_SERVICES)
@mkdir -p $(productservicesimage_intermediates) && rm -rf $(productservicesimage_intermediates)/productservices_image_info.txt
$(call generate-userimage-prop-dictionary, $(productservicesimage_intermediates)/productservices_image_info.txt, skip_fsck=true)
@mkdir -p $(product_servicesimage_intermediates) && rm -rf $(product_servicesimage_intermediates)/product_services_image_info.txt
$(call generate-image-prop-dictionary, $(product_servicesimage_intermediates)/product_services_image_info.txt,product_services, skip_fsck=true)
$(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \
./build/tools/releasetools/build_image.py \
$(TARGET_OUT_PRODUCT_SERVICES) $(productservicesimage_intermediates)/productservices_image_info.txt $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) $(TARGET_OUT) \
$(productservicesimage_intermediates)/generated_productservices_image_info.txt
$(TARGET_OUT_PRODUCT_SERVICES) $(product_servicesimage_intermediates)/product_services_image_info.txt $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET) $(TARGET_OUT) \
$(product_servicesimage_intermediates)/generated_product_services_image_info.txt
$(hide) $(call assert-max-image-size,$(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET),\
$(call read-image-prop-dictionary,\
$(productservicesimage_intermediates)/generated_productservices_image_info.txt,productservices_size))
$(product_servicesimage_intermediates)/generated_product_services_image_info.txt,product_services_size))
endef
# We just build this directly to the install location.
INSTALLED_PRODUCT_SERVICESIMAGE_TARGET := $(BUILT_PRODUCT_SERVICESIMAGE_TARGET)
$(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) $(INTERNAL_PRODUCT_SERVICESIMAGE_FILES) $(INSTALLED_FILES_FILE_PRODUCT_SERVICES) $(BUILD_IMAGE_SRCS)
$(build-productservicesimage-target)
$(build-product-servicesimage-target)
.PHONY: productservicesimage-nodeps psnod
productservicesimage-nodeps psnod: | $(INTERNAL_USERIMAGES_DEPS)
$(build-productservicesimage-target)
$(build-product-servicesimage-target)
sync: $(INTERNAL_PRODUCT_SERVICESIMAGE_FILES)
@ -2558,6 +2558,62 @@ $(INSTALLED_VBMETAIMAGE_TARGET): $(AVBTOOL)
endif # BOARD_AVB_ENABLE
# -----------------------------------------------------------------
# super partition image
# (1): list of items like "system", "vendor", "product", "product_services"
# return: map each item to the corresponding image target.
# system => $(BUILT_SYSTEMIMAGE), vendor => $(INSTALLED_VENDORIMAGE_TARGET), etc.
define image-for-partitions
$(foreach item,$(1),$(or $(strip $(foreach mapping,
system:$(BUILT_SYSTEMIMAGE)
product_services:$(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET),
$(if $(filter $(call word-colon,1,$(mapping)),$(item)),
$(patsubst $(call word-colon,1,$(mapping)),$(call word-colon,2,$(mapping)),$(item))))),
$(INSTALLED_$(call to-upper,$(item)IMAGE_TARGET))))
endef
# (1): list of items like "system", "vendor", "product", "product_services"
# return: map each item into a command ( wrapped in $$() ) that reads the size
define read-size-of-partitions
$(foreach p,$(1),$(call read-image-prop-dictionary,$($(p)image_intermediates)/generated_$(p)_image_info.txt,$(p)_size))
endef
ifeq (true,$(USE_LOGICAL_PARTITIONS))
# BOARD_SUPER_PARTITION_SIZE must be defined to build super image.
ifdef BOARD_SUPER_PARTITION_SIZE
INSTALLED_SUPERIMAGE_TARGET := $(PRODUCT_OUT)/super.img
$(INSTALLED_SUPERIMAGE_TARGET): $(call image-for-partitions,$(BOARD_SUPER_PARTITION_PARTITION_LIST))
# For A/B devices, super partition always contains sub-partitions in the _a slot, because this
# image should only be used for bootstrapping / initializing the device. When flashing the image,
# bootloader fastboot should always mark _a slot as bootable.
ifeq ($(AB_OTA_UPDATER),true)
$(INSTALLED_SUPERIMAGE_TARGET): PRIVATE_PARTITION_SUFFIX=_a
$(INSTALLED_SUPERIMAGE_TARGET): PRIVATE_METADATA_SLOTS=2
else
$(INSTALLED_SUPERIMAGE_TARGET): PRIVATE_METADATA_SLOTS=1
endif # AB_OTA_UPDATER
$(INSTALLED_SUPERIMAGE_TARGET): $(HOST_OUT_EXECUTABLES)/lpmake
$< \
--sparse \
--metadata-size 65536 \
--metadata-slots $(PRIVATE_METADATA_SLOTS) \
--device-size $(BOARD_SUPER_PARTITION_SIZE) \
--output $@ \
$(foreach name,$(BOARD_SUPER_PARTITION_PARTITION_LIST), \
--partition $(name)$(PRIVATE_PARTITION_SUFFIX):$$($(UUIDGEN) $(name)$(PRIVATE_PARTITION_SUFFIX)):readonly:$(call read-size-of-partitions,$(name)) \
--image $(name)$(PRIVATE_PARTITION_SUFFIX)=$(call image-for-partitions,$(name)))
$(call dist-for-goals,dist_files,$(INSTALLED_SUPERIMAGE_TARGET))
endif # BOARD_SUPER_PARTITION_SIZE
endif # USE_LOGICAL_PARTITIONS
# -----------------------------------------------------------------
# Check image sizes <= size of super partition
@ -2573,21 +2629,10 @@ droid_targets: check_android_partition_sizes
.PHONY: check_android_partition_sizes
# Add image dependencies so that generated_*_image_info.txt are written before checking.
ifneq (,$(filter system,$(BOARD_SUPER_PARTITION_PARTITION_LIST)))
check_android_partition_sizes: $(BUILT_SYSTEMIMAGE)
endif
ifneq (,$(filter vendor,$(BOARD_SUPER_PARTITION_PARTITION_LIST)))
check_android_partition_sizes: $(INSTALLED_VENDORIMAGE_TARGET)
endif
ifneq (,$(filter product,$(BOARD_SUPER_PARTITION_PARTITION_LIST)))
check_android_partition_sizes: $(INSTALLED_PRODUCTIMAGE_TARGET)
endif
ifneq (,$(filter productservices,$(BOARD_SUPER_PARTITION_PARTITION_LIST)))
check_android_partition_sizes: $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET)
endif
check_android_partition_sizes: $(call image-for-partitions,$(BOARD_SUPER_PARTITION_PARTITION_LIST))
check_android_partition_sizes:
partition_size_list="$(foreach p,$(BOARD_SUPER_PARTITION_PARTITION_LIST),$(call read-image-prop-dictionary,$($(p)image_intermediates)/generated_$(p)_image_info.txt,$(p)_size))"; \
partition_size_list="$(call read-size-of-partitions,$(BOARD_SUPER_PARTITION_PARTITION_LIST))"; \
sum_sizes_expr=$$(sed -e 's/ /+/g' <<< "$${partition_size_list}"); \
if [ $$(( $${sum_sizes_expr} )) -gt $(BOARD_SUPER_PARTITION_SIZE) ]; then \
echo 'The sum of sizes of all logical partitions is larger than BOARD_SUPER_PARTITION_SIZE.'; \
@ -2872,7 +2917,7 @@ $(BUILT_TARGET_FILES_PACKAGE): \
@echo "Package target files: $@"
$(call create-system-vendor-symlink)
$(call create-system-product-symlink)
$(call create-system-productservices-symlink)
$(call create-system-product-services-symlink)
$(hide) rm -rf $@ $@.list $(zip_root)
$(hide) mkdir -p $(dir $@) $(zip_root)
ifneq (,$(INSTALLED_RECOVERYIMAGE_TARGET)$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)))
@ -3140,7 +3185,7 @@ ifdef BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE
$(hide) $(call fs_config,$(zip_root)/PRODUCT,product/) > $(zip_root)/META/product_filesystem_config.txt
endif
ifdef BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE
$(hide) $(call fs_config,$(zip_root)/PRODUCT_SERVICES,product-services/) > $(zip_root)/META/productservices_filesystem_config.txt
$(hide) $(call fs_config,$(zip_root)/PRODUCT_SERVICES,product-services/) > $(zip_root)/META/product_services_filesystem_config.txt
endif
ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
@# When using BOARD_BUILD_SYSTEM_ROOT_IMAGE, ROOT always contains the files for the root under

View File

@ -707,6 +707,7 @@ JARJAR := $(HOST_OUT_JAVA_LIBRARIES)/jarjar.jar
DATA_BINDING_COMPILER := $(HOST_OUT_JAVA_LIBRARIES)/databinding-compiler.jar
FAT16COPY := build/make/tools/fat16copy.py
CHECK_LINK_TYPE := build/make/tools/check_link_type.py
UUIDGEN := build/make/tools/uuidgen.py
PROGUARD := external/proguard/bin/proguard.sh
JAVATAGS := build/make/tools/java-event-log-tags.py
@ -985,10 +986,11 @@ endif
ifdef BOARD_SUPER_PARTITION_PARTITION_LIST
# BOARD_SUPER_PARTITION_PARTITION_LIST: a list of the following tokens
valid_super_partition_list := system vendor product productservices
valid_super_partition_list := system vendor product product_services
ifneq (,$(filter-out $(valid_super_partition_list),$(BOARD_SUPER_PARTITION_PARTITION_LIST)))
$(error BOARD_SUPER_PARTITION_PARTITION_LIST contains invalid partition name. \
Valid names are $(valid_super_partition_list).)
$(error BOARD_SUPER_PARTITION_PARTITION_LIST contains invalid partition name \
($(filter-out $(valid_super_partition_list),$(BOARD_SUPER_PARTITION_PARTITION_LIST))). \
Valid names are $(valid_super_partition_list))
endif
valid_super_partition_list :=
endif # BOARD_SUPER_PARTITION_PARTITION_LIST

View File

@ -218,8 +218,8 @@ TARGET_COPY_OUT_PRODUCT := $(_product_path_placeholder)
# A device can set up TARGET_COPY_OUT_PRODUCT_SERVICES to "product-services" in its
# BoardConfig.mk.
# We'll substitute with the real value after loading BoardConfig.mk.
_productservices_path_placeholder := ||PRODUCTSERVICES-PATH-PH||
TARGET_COPY_OUT_PRODUCT_SERVICES := $(_productservices_path_placeholder)
_product_services_path_placeholder := ||PRODUCT-SERVICES-PATH-PH||
TARGET_COPY_OUT_PRODUCT_SERVICES := $(_product_services_path_placeholder)
###########################################
#################################################################
@ -355,12 +355,12 @@ endif
###########################################
# Now we can substitute with the real value of TARGET_COPY_OUT_PRODUCT_SERVICES
ifeq ($(TARGET_COPY_OUT_PRODUCT_SERVICES),$(_productservices_path_placeholder))
ifeq ($(TARGET_COPY_OUT_PRODUCT_SERVICES),$(_product_services_path_placeholder))
TARGET_COPY_OUT_PRODUCT_SERVICES := system/product-services
else ifeq ($(filter product-services system/product-services,$(TARGET_COPY_OUT_PRODUCT_SERVICES)),)
$(error TARGET_COPY_OUT_PRODUCT_SERVICES must be either 'product-services' or 'system/product-services', seeing '$(TARGET_COPY_OUT_PRODUCT_SERVICES)'.)
endif
PRODUCT_SERVICES_COPY_FILES := $(subst $(_productservices_path_placeholder),$(TARGET_COPY_OUT_PRODUCT_SERVICES),$(PRODUCT_SERVICES_COPY_FILES))
PRODUCT_SERVICES_COPY_FILES := $(subst $(_product_services_path_placeholder),$(TARGET_COPY_OUT_PRODUCT_SERVICES),$(PRODUCT_SERVICES_COPY_FILES))
BOARD_USES_PRODUCT_SERVICESIMAGE :=
ifdef BOARD_PREBUILT_PRODUCT_SERVICESIMAGE
@ -916,33 +916,33 @@ $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_APPS_PRIVILEGED := $(TARGET_OUT_
TARGET_OUT_PRODUCT_SERVICES := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_PRODUCT_SERVICES)
ifneq ($(filter address,$(SANITIZE_TARGET)),)
target_out_productservices_shared_libraries_base := $(PRODUCT_SERVICES_OUT)/$(TARGET_COPY_OUT_ASAN)/product-services
target_out_product_services_shared_libraries_base := $(PRODUCT_SERVICES_OUT)/$(TARGET_COPY_OUT_ASAN)/product-services
ifeq ($(SANITIZE_LITE),true)
# When using SANITIZE_LITE, APKs must not be packaged with sanitized libraries, as they will not
# work with unsanitized app_process. For simplicity, generate APKs into /data/asan/.
target_out_productservices_app_base := $(PRODUCT_SERVICES_OUT)/$(TARGET_COPY_OUT_ASAN)/product-services
target_out_product_services_app_base := $(PRODUCT_SERVICES_OUT)/$(TARGET_COPY_OUT_ASAN)/product-services
else
target_out_productservices_app_base := $(TARGET_OUT_PRODUCT_SERVICES)
target_out_product_services_app_base := $(TARGET_OUT_PRODUCT_SERVICES)
endif
else
target_out_productservices_shared_libraries_base := $(TARGET_OUT_PRODUCT_SERVICES)
target_out_productservices_app_base := $(TARGET_OUT_PRODUCT_SERVICES)
target_out_product_services_shared_libraries_base := $(TARGET_OUT_PRODUCT_SERVICES)
target_out_product_services_app_base := $(TARGET_OUT_PRODUCT_SERVICES)
endif
ifeq ($(TARGET_IS_64_BIT),true)
TARGET_OUT_PRODUCT_SERVICES_SHARED_LIBRARIES := $(target_out_productservices_shared_libraries_base)/lib64
TARGET_OUT_PRODUCT_SERVICES_SHARED_LIBRARIES := $(target_out_product_services_shared_libraries_base)/lib64
else
TARGET_OUT_PRODUCT_SERVICES_SHARED_LIBRARIES := $(target_out_productservices_shared_libraries_base)/lib
TARGET_OUT_PRODUCT_SERVICES_SHARED_LIBRARIES := $(target_out_product_services_shared_libraries_base)/lib
endif
TARGET_OUT_PRODUCT_SERVICES_JAVA_LIBRARIES:= $(TARGET_OUT_PRODUCT_SERVICES)/framework
TARGET_OUT_PRODUCT_SERVICES_APPS := $(target_out_productservices_app_base)/app
TARGET_OUT_PRODUCT_SERVICES_APPS_PRIVILEGED := $(target_out_productservices_app_base)/priv-app
TARGET_OUT_PRODUCT_SERVICES_APPS := $(target_out_product_services_app_base)/app
TARGET_OUT_PRODUCT_SERVICES_APPS_PRIVILEGED := $(target_out_product_services_app_base)/priv-app
TARGET_OUT_PRODUCT_SERVICES_ETC := $(TARGET_OUT_PRODUCT_SERVICES)/etc
ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_SERVICES_SHARED_LIBRARIES := $(target_out_productservices_shared_libraries_base)/lib/$(TARGET_2ND_ARCH)
$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_SERVICES_SHARED_LIBRARIES := $(target_out_product_services_shared_libraries_base)/lib/$(TARGET_2ND_ARCH)
else
$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_SERVICES_SHARED_LIBRARIES := $(target_out_productservices_shared_libraries_base)/lib
$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_SERVICES_SHARED_LIBRARIES := $(target_out_product_services_shared_libraries_base)/lib
endif
$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_SERVICES_APPS := $(TARGET_OUT_PRODUCT_SERVICES_APPS)
$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_SERVICES_APPS_PRIVILEGED := $(TARGET_OUT_PRODUCT_SERVICES_APPS_PRIVILEGED)

View File

@ -1205,6 +1205,9 @@ productservicesimage: $(INSTALLED_PRODUCT_SERVICESIMAGE_TARGET)
.PHONY: systemotherimage
systemotherimage: $(INSTALLED_SYSTEMOTHERIMAGE_TARGET)
.PHONY: superimage
superimage: $(INSTALLED_SUPERIMAGE_TARGET)
.PHONY: bootimage
bootimage: $(INSTALLED_BOOTIMAGE_TARGET)

View File

@ -653,11 +653,11 @@ def AddImagesToTargetFiles(filename):
has_product = (os.path.isdir(os.path.join(OPTIONS.input_tmp, "PRODUCT")) or
os.path.exists(os.path.join(OPTIONS.input_tmp, "IMAGES",
"product.img")))
has_productservices = (os.path.isdir(os.path.join(OPTIONS.input_tmp,
"PRODUCTSERVICES")) or
os.path.exists(os.path.join(OPTIONS.input_tmp,
"IMAGES",
"product-services.img")))
has_product_services = (os.path.isdir(os.path.join(OPTIONS.input_tmp,
"PRODUCT_SERVICES")) or
os.path.exists(os.path.join(OPTIONS.input_tmp,
"IMAGES",
"product-services.img")))
has_system_other = os.path.isdir(os.path.join(OPTIONS.input_tmp,
"SYSTEM_OTHER"))
@ -734,7 +734,7 @@ def AddImagesToTargetFiles(filename):
banner("product")
partitions['product'] = AddProduct(output_zip)
if has_productservices:
if has_product_services:
banner("product-services")
partitions['product-services'] = AddProductServices(output_zip)

View File

@ -908,27 +908,27 @@ def ImagePropFromGlobalDict(glob_dict, mount_point):
d["extfs_rsv_pct"] = "0"
copy_prop("product_reserved_size", "partition_reserved_size")
elif mount_point == "product-services":
copy_prop("avb_productservices_hashtree_enable", "avb_hashtree_enable")
copy_prop("avb_productservices_add_hashtree_footer_args",
copy_prop("avb_product_services_hashtree_enable", "avb_hashtree_enable")
copy_prop("avb_product_services_add_hashtree_footer_args",
"avb_add_hashtree_footer_args")
copy_prop("avb_productservices_key_path", "avb_key_path")
copy_prop("avb_productservices_algorithm", "avb_algorithm")
copy_prop("productservices_fs_type", "fs_type")
copy_prop("productservices_size", "partition_size")
if not copy_prop("productservices_journal_size", "journal_size"):
copy_prop("avb_product_services_key_path", "avb_key_path")
copy_prop("avb_product_services_algorithm", "avb_algorithm")
copy_prop("product_services_fs_type", "fs_type")
copy_prop("product_services_size", "partition_size")
if not copy_prop("product_services_journal_size", "journal_size"):
d["journal_size"] = "0"
copy_prop("productservices_verity_block_device", "verity_block_device")
copy_prop("productservices_squashfs_compressor", "squashfs_compressor")
copy_prop("productservices_squashfs_compressor_opt",
copy_prop("product_services_verity_block_device", "verity_block_device")
copy_prop("product_services_squashfs_compressor", "squashfs_compressor")
copy_prop("product_services_squashfs_compressor_opt",
"squashfs_compressor_opt")
copy_prop("productservices_squashfs_block_size", "squashfs_block_size")
copy_prop("productservices_squashfs_disable_4k_align",
copy_prop("product_services_squashfs_block_size", "squashfs_block_size")
copy_prop("product_services_squashfs_disable_4k_align",
"squashfs_disable_4k_align")
copy_prop("productservices_base_fs_file", "base_fs_file")
copy_prop("productservices_extfs_inode_count", "extfs_inode_count")
if not copy_prop("productservices_extfs_rsv_pct", "extfs_rsv_pct"):
copy_prop("product_services_base_fs_file", "base_fs_file")
copy_prop("product_services_extfs_inode_count", "extfs_inode_count")
if not copy_prop("product_services_extfs_rsv_pct", "extfs_rsv_pct"):
d["extfs_rsv_pct"] = "0"
copy_prop("productservices_reserved_size", "partition_reserved_size")
copy_prop("product_services_reserved_size", "partition_reserved_size")
elif mount_point == "oem":
copy_prop("fs_type", "fs_type")
copy_prop("oem_size", "partition_size")
@ -977,7 +977,7 @@ def GlobalDictFromImageProp(image_prop, mount_point):
elif mount_point == "product":
copy_prop(size_property, "product_size")
elif mount_point == "product-services":
copy_prop(size_property, "productservices_size")
copy_prop(size_property, "product_services_size")
return d

29
tools/uuidgen.py Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env python
#
# Copyright 2018 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import sys
import uuid
def uuidgen(name):
return uuid.uuid5(uuid.uuid5(uuid.NAMESPACE_URL, "android.com"), name)
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: uuidgen.py <name>")
sys.exit(1)
name = sys.argv[1]
print(uuidgen(name))