Compare commits
73 commits
43bfd62c88
...
0ee73fcd93
Author | SHA1 | Date | |
---|---|---|---|
|
0ee73fcd93 | ||
|
4bd23deef4 | ||
|
12fa5410d1 | ||
|
ef1f47fc07 | ||
|
2e615745ce | ||
|
45a7c8cf92 | ||
|
65b9ee2040 | ||
|
4d8f8c5906 | ||
|
b2aafc4f2f | ||
|
6e875791eb | ||
|
f41361569b | ||
|
b98cf3cf21 | ||
|
92cc83d5f2 | ||
|
b91b0f1462 | ||
|
8fac570055 | ||
|
c5505418b4 | ||
|
a83dd3bc49 | ||
|
f6a5a12325 | ||
|
0fc77ec51e | ||
|
4080494752 | ||
|
28e997681e | ||
|
d233aeb780 | ||
|
390c3a63af | ||
|
99ea7632bb | ||
|
a26124d361 | ||
|
0eda3e0123 | ||
|
7713f520fa | ||
|
f84254ef1b | ||
|
201b843839 | ||
|
73d586ad36 | ||
|
36727b55ff | ||
|
8aab9617db | ||
|
1c390cd216 | ||
|
28d41a4097 | ||
|
14ea1e60c6 | ||
|
136394bf16 | ||
|
554a1915a8 | ||
|
3c2c75b556 | ||
|
56c9b0fb10 | ||
|
3ac02eee13 | ||
|
2fa06c1c39 | ||
|
82d9f1507a | ||
|
6ee8d10147 | ||
|
8b69c4d0a0 | ||
|
453fe9d9a0 | ||
|
ef7318daaf | ||
|
2131227516 | ||
|
9b1095722e | ||
|
3329a204d2 | ||
|
94b75b4429 | ||
|
fe27b5e0ed | ||
|
bc0ef30e0e | ||
|
44112727ed | ||
|
e7ee416ff9 | ||
|
d76725c913 | ||
|
30f779c15b | ||
|
c161964bde | ||
|
8ba776d32f | ||
|
f0509ac9bd | ||
|
cff3412a4e | ||
|
e7e735832d | ||
|
85dc11c468 | ||
|
40cfceed2a | ||
|
82633d9de8 | ||
|
21f38c6d8e | ||
|
dfcb38a988 | ||
|
0da100cff3 | ||
|
a6a4d684dc | ||
|
3bafdb4dd6 | ||
|
a47c7368d7 | ||
|
a3a2ca917a | ||
|
fb9cae1e23 | ||
|
7fc166ebd7 |
36 changed files with 715 additions and 476 deletions
185
core/Makefile
185
core/Makefile
|
@ -1021,6 +1021,17 @@ else
|
|||
INSTALLED_KERNEL_TARGET :=
|
||||
endif
|
||||
|
||||
ifdef INSTALLED_KERNEL_TARGET
|
||||
ifneq (,$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)))
|
||||
INSTALLED_RECOVERY_KERNEL_TARGET := $(INSTALLED_KERNEL_TARGET)
|
||||
else ifneq (true,$(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE))
|
||||
ifneq "$(or $(TARGET_KERNEL_RECOVERY_CONFIG), $(TARGET_PREBUILT_RECOVERY_KERNEL))" ""
|
||||
INSTALLED_RECOVERY_KERNEL_TARGET := $(PRODUCT_OUT)/recovery_kernel
|
||||
else
|
||||
INSTALLED_RECOVERY_KERNEL_TARGET := $(firstword $(INSTALLED_KERNEL_TARGET))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
# -----------------------------------------------------------------
|
||||
# the root dir
|
||||
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_ROOT_OUT)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
|
||||
|
@ -1197,6 +1208,10 @@ ifeq ($(BOARD_RAMDISK_USE_LZ4),true)
|
|||
COMPRESSION_COMMAND_DEPS := $(LZ4)
|
||||
COMPRESSION_COMMAND := $(LZ4) -l -12 --favor-decSpeed
|
||||
RAMDISK_EXT := .lz4
|
||||
else ifeq ($(BOARD_RAMDISK_USE_XZ),true)
|
||||
COMPRESSION_COMMAND_DEPS := $(XZ)
|
||||
COMPRESSION_COMMAND := $(XZ) -f -c --check=crc32 --lzma2=dict=32MiB
|
||||
RAMDISK_EXT := .xz
|
||||
else
|
||||
COMPRESSION_COMMAND_DEPS := $(GZIP)
|
||||
COMPRESSION_COMMAND := $(GZIP)
|
||||
|
@ -1343,10 +1358,18 @@ INTERNAL_MKBOOTIMG_VERSION_ARGS := \
|
|||
--os_version $(PLATFORM_VERSION_LAST_STABLE) \
|
||||
--os_patch_level $(PLATFORM_SECURITY_PATCH)
|
||||
|
||||
ifeq ($(strip $(BOARD_KERNEL_SEPARATED_DT)),true)
|
||||
INSTALLED_DTIMAGE_TARGET := $(PRODUCT_OUT)/dt.img
|
||||
INTERNAL_BOOTIMAGE_ARGS += --dt $(INSTALLED_DTIMAGE_TARGET)
|
||||
BOOTIMAGE_EXTRA_DEPS := $(INSTALLED_DTIMAGE_TARGET)
|
||||
endif
|
||||
|
||||
# Define these only if we are building boot
|
||||
ifdef BUILDING_BOOT_IMAGE
|
||||
INSTALLED_BOOTIMAGE_TARGET := $(BUILT_BOOTIMAGE_TARGET)
|
||||
|
||||
ifndef BOARD_CUSTOM_BOOTIMG_MK
|
||||
|
||||
ifeq ($(TARGET_BOOTIMAGE_USE_EXT2),true)
|
||||
$(error TARGET_BOOTIMAGE_USE_EXT2 is not supported anymore)
|
||||
endif # TARGET_BOOTIMAGE_USE_EXT2
|
||||
|
@ -1361,7 +1384,7 @@ define build_boot_board_avb_enabled
|
|||
$(call build_boot_from_kernel_avb_enabled,$(1),$(kernel))
|
||||
endef
|
||||
|
||||
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(AVBTOOL) $(INTERNAL_BOOTIMAGE_FILES) $(BOARD_AVB_BOOT_KEY_PATH)
|
||||
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(AVBTOOL) $(INTERNAL_BOOTIMAGE_FILES) $(BOARD_AVB_BOOT_KEY_PATH) $(BOOTIMAGE_EXTRA_DEPS)
|
||||
$(call pretty,"Target boot image: $@")
|
||||
$(call build_boot_board_avb_enabled,$@)
|
||||
|
||||
|
@ -1384,7 +1407,7 @@ define build_boot_supports_vboot
|
|||
$(call assert-max-image-size,$(1),$(call get-bootimage-partition-size,$(1),boot))
|
||||
endef
|
||||
|
||||
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(VBOOT_SIGNER) $(FUTILITY)
|
||||
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(VBOOT_SIGNER) $(FUTILITY) $(BOOTIMAGE_EXTRA_DEPS)
|
||||
$(call pretty,"Target boot image: $@")
|
||||
$(call build_boot_supports_vboot,$@)
|
||||
|
||||
|
@ -1406,7 +1429,7 @@ define build_boot_novboot
|
|||
$(call assert-max-image-size,$1,$(call get-bootimage-partition-size,$(1),boot))
|
||||
endef
|
||||
|
||||
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES)
|
||||
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) $(BOOTIMAGE_EXTRA_DEPS)
|
||||
$(call pretty,"Target boot image: $@")
|
||||
$(call build_boot_novboot,$@)
|
||||
|
||||
|
@ -1421,6 +1444,7 @@ bootimage-nodeps: $(MKBOOTIMG)
|
|||
$(foreach b,$(INSTALLED_BOOTIMAGE_TARGET),$(call build_boot_novboot,$(b)))
|
||||
|
||||
endif # BOARD_AVB_ENABLE
|
||||
endif # BOARD_CUSTOM_BOOTIMG_MK not defined
|
||||
endif # BUILDING_BOOT_IMAGE
|
||||
|
||||
else # TARGET_NO_KERNEL == "true"
|
||||
|
@ -2142,9 +2166,11 @@ $(if $(BOARD_$(_var)IMAGE_SQUASHFS_COMPRESSOR),$(hide) echo "$(1)_squashfs_compr
|
|||
$(if $(BOARD_$(_var)IMAGE_SQUASHFS_COMPRESSOR_OPT),$(hide) echo "$(1)_squashfs_compressor_opt=$(BOARD_$(_var)IMAGE_SQUASHFS_COMPRESSOR_OPT)" >> $(2))
|
||||
$(if $(BOARD_$(_var)IMAGE_SQUASHFS_DISABLE_4K_ALIGN),$(hide) echo "$(1)_squashfs_disable_4k_align=$(BOARD_$(_var)IMAGE_SQUASHFS_DISABLE_4K_ALIGN)" >> $(2))
|
||||
$(if $(PRODUCT_$(_var)_BASE_FS_PATH),$(hide) echo "$(1)_base_fs_file=$(PRODUCT_$(_var)_BASE_FS_PATH)" >> $(2))
|
||||
$(eval _size := $(BOARD_$(_var)IMAGE_PARTITION_SIZE))
|
||||
$(eval _reserved := $(BOARD_$(_var)IMAGE_PARTITION_RESERVED_SIZE))
|
||||
$(eval _headroom := $(PRODUCT_$(_var)_HEADROOM))
|
||||
$(if $(filter true,$(AB_OTA_UPDATER)),,\
|
||||
$(eval _size := $(BOARD_$(_var)IMAGE_PARTITION_SIZE))
|
||||
$(eval _reserved := $(BOARD_$(_var)IMAGE_PARTITION_RESERVED_SIZE))
|
||||
$(eval _headroom := $(PRODUCT_$(_var)_HEADROOM))
|
||||
)
|
||||
$(if $(or $(_size), $(_reserved), $(_headroom)),,
|
||||
$(hide) echo "$(1)_disable_sparse=true" >> $(2))
|
||||
$(call add-common-flags-to-image-props,$(1),$(2))
|
||||
|
@ -2369,6 +2395,8 @@ ifdef BUILDING_RECOVERY_IMAGE
|
|||
|
||||
INTERNAL_RECOVERYIMAGE_FILES := $(filter $(TARGET_RECOVERY_OUT)/%, \
|
||||
$(ALL_DEFAULT_INSTALLED_MODULES))
|
||||
INTERNAL_RECOVERYIMAGE_FILES += $(filter $(PRODUCT_OUT)/install/%, \
|
||||
$(ALL_DEFAULT_INSTALLED_MODULES))
|
||||
|
||||
INSTALLED_FILES_FILE_RECOVERY := $(PRODUCT_OUT)/installed-files-recovery.txt
|
||||
INSTALLED_FILES_JSON_RECOVERY := $(INSTALLED_FILES_FILE_RECOVERY:.txt=.json)
|
||||
|
@ -2417,10 +2445,14 @@ IGNORE_RECOVERY_SEPOLICY := $(patsubst $(TARGET_RECOVERY_OUT)/%,--exclude=/%,$(r
|
|||
|
||||
# if building multiple boot images from multiple kernels, use the first kernel listed
|
||||
# for the recovery image
|
||||
recovery_kernel := $(firstword $(INSTALLED_KERNEL_TARGET))
|
||||
recovery_kernel := $(INSTALLED_RECOVERY_KERNEL_TARGET)
|
||||
recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img
|
||||
recovery_uncompressed_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.cpio
|
||||
recovery_resources_common := bootable/recovery/res
|
||||
|
||||
ifneq (,$(TARGET_RECOVERY_DENSITY))
|
||||
recovery_density := $(filter %dpi,$(TARGET_RECOVERY_DENSITY))
|
||||
else
|
||||
# Set recovery_density to a density bucket based on TARGET_SCREEN_DENSITY, PRODUCT_AAPT_PREF_CONFIG,
|
||||
# or mdpi, in order of preference. We support both specific buckets (e.g. xdpi) and numbers,
|
||||
# which get remapped to a bucket.
|
||||
|
@ -2436,6 +2468,7 @@ recovery_density := $(strip \
|
|||
$(if $(filter $(shell echo $$(($(recovery_density_value) >= 280))),1),xhdpi),\
|
||||
$(if $(filter $(shell echo $$(($(recovery_density_value) >= 200))),1),hdpi,mdpi)))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq (,$(wildcard $(recovery_resources_common)-$(recovery_density)))
|
||||
recovery_resources_common := $(recovery_resources_common)-$(recovery_density)
|
||||
|
@ -2479,23 +2512,12 @@ RECOVERY_ERASING_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/erasing_te
|
|||
RECOVERY_ERROR_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/error_text.png
|
||||
RECOVERY_NO_COMMAND_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/no_command_text.png
|
||||
|
||||
RECOVERY_CANCEL_WIPE_DATA_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/cancel_wipe_data_text.png
|
||||
RECOVERY_FACTORY_DATA_RESET_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/factory_data_reset_text.png
|
||||
RECOVERY_TRY_AGAIN_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/try_again_text.png
|
||||
RECOVERY_WIPE_DATA_CONFIRMATION_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/wipe_data_confirmation_text.png
|
||||
RECOVERY_WIPE_DATA_MENU_HEADER_TEXT_FILE := $(dir $(RECOVERY_INSTALLING_TEXT_FILE))/wipe_data_menu_header_text.png
|
||||
|
||||
generated_recovery_text_files := \
|
||||
$(RECOVERY_INSTALLING_TEXT_FILE) \
|
||||
$(RECOVERY_INSTALLING_SECURITY_TEXT_FILE) \
|
||||
$(RECOVERY_ERASING_TEXT_FILE) \
|
||||
$(RECOVERY_ERROR_TEXT_FILE) \
|
||||
$(RECOVERY_NO_COMMAND_TEXT_FILE) \
|
||||
$(RECOVERY_CANCEL_WIPE_DATA_TEXT_FILE) \
|
||||
$(RECOVERY_FACTORY_DATA_RESET_TEXT_FILE) \
|
||||
$(RECOVERY_TRY_AGAIN_TEXT_FILE) \
|
||||
$(RECOVERY_WIPE_DATA_CONFIRMATION_TEXT_FILE) \
|
||||
$(RECOVERY_WIPE_DATA_MENU_HEADER_TEXT_FILE)
|
||||
|
||||
resource_dir := bootable/recovery/tools/recovery_l10n/res/
|
||||
resource_dir_deps := $(sort $(shell find $(resource_dir) -name *.xml -not -name .*))
|
||||
|
@ -2513,12 +2535,6 @@ $(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST := \
|
|||
recovery_erasing \
|
||||
recovery_error \
|
||||
recovery_no_command
|
||||
$(RECOVERY_INSTALLING_TEXT_FILE): PRIVATE_RECOVERY_WIPE_DATA_TEXT_LIST := \
|
||||
recovery_cancel_wipe_data \
|
||||
recovery_factory_data_reset \
|
||||
recovery_try_again \
|
||||
recovery_wipe_data_menu_header \
|
||||
recovery_wipe_data_confirmation
|
||||
$(RECOVERY_INSTALLING_TEXT_FILE): .KATI_IMPLICIT_OUTPUTS := $(filter-out $(RECOVERY_INSTALLING_TEXT_FILE),$(generated_recovery_text_files))
|
||||
$(RECOVERY_INSTALLING_TEXT_FILE): $(image_generator_jar) $(resource_dir_deps) $(recovery_noto-fonts_dep) $(recovery_roboto-fonts_dep) $(zopflipng)
|
||||
# Prepares the font directory.
|
||||
|
@ -2527,7 +2543,7 @@ $(RECOVERY_INSTALLING_TEXT_FILE): $(image_generator_jar) $(resource_dir_deps) $(
|
|||
$(foreach filename,$(PRIVATE_SOURCE_FONTS), cp $(filename) $(PRIVATE_RECOVERY_FONT_FILES_DIR) &&) true
|
||||
@rm -rf $(dir $@)
|
||||
@mkdir -p $(dir $@)
|
||||
$(foreach text_name,$(PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST) $(PRIVATE_RECOVERY_WIPE_DATA_TEXT_LIST), \
|
||||
$(foreach text_name,$(PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST), \
|
||||
$(eval output_file := $(dir $@)/$(patsubst recovery_%,%_text.png,$(text_name))) \
|
||||
$(eval center_alignment := $(if $(filter $(text_name),$(PRIVATE_RECOVERY_BACKGROUND_TEXT_LIST)), --center_alignment)) \
|
||||
java -jar $(PRIVATE_IMAGE_GENERATOR_JAR) \
|
||||
|
@ -2543,13 +2559,18 @@ RECOVERY_INSTALLING_SECURITY_TEXT_FILE :=
|
|||
RECOVERY_ERASING_TEXT_FILE :=
|
||||
RECOVERY_ERROR_TEXT_FILE :=
|
||||
RECOVERY_NO_COMMAND_TEXT_FILE :=
|
||||
RECOVERY_CANCEL_WIPE_DATA_TEXT_FILE :=
|
||||
RECOVERY_FACTORY_DATA_RESET_TEXT_FILE :=
|
||||
RECOVERY_TRY_AGAIN_TEXT_FILE :=
|
||||
RECOVERY_WIPE_DATA_CONFIRMATION_TEXT_FILE :=
|
||||
RECOVERY_WIPE_DATA_MENU_HEADER_TEXT_FILE :=
|
||||
endif # TARGET_RECOVERY_UI_SCREEN_WIDTH
|
||||
|
||||
ifneq ($(TARGET_RECOVERY_DEVICE_DIRS),)
|
||||
recovery_root_private := $(strip \
|
||||
$(foreach d,$(TARGET_RECOVERY_DEVICE_DIRS), $(wildcard $(d)/recovery/root)))
|
||||
else
|
||||
recovery_root_private := $(strip $(wildcard $(TARGET_DEVICE_DIR)/recovery/root))
|
||||
endif
|
||||
ifneq ($(recovery_root_private),)
|
||||
recovery_root_deps := $(shell find $(recovery_root_private) -type f)
|
||||
endif
|
||||
|
||||
ifndef TARGET_PRIVATE_RES_DIRS
|
||||
TARGET_PRIVATE_RES_DIRS := $(wildcard $(TARGET_DEVICE_DIR)/recovery/res)
|
||||
endif
|
||||
|
@ -2594,7 +2615,7 @@ endif
|
|||
|
||||
ifeq (,$(filter true, $(BOARD_USES_FULL_RECOVERY_IMAGE) $(BOARD_USES_RECOVERY_AS_BOOT) \
|
||||
$(BOARD_INCLUDE_RECOVERY_DTBO) $(BOARD_INCLUDE_RECOVERY_ACPIO) \
|
||||
$(BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT)))
|
||||
$(BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT) $(BOARD_RAMDISK_USE_LZ4) $(BOARD_RAMDISK_USE_XZ)))
|
||||
# Named '.dat' so we don't attempt to use imgdiff for patching it.
|
||||
RECOVERY_RESOURCE_ZIP := $(TARGET_OUT_VENDOR)/etc/recovery-resource.dat
|
||||
ALL_DEFAULT_INSTALLED_MODULES += $(RECOVERY_RESOURCE_ZIP)
|
||||
|
@ -2606,6 +2627,7 @@ INSTALLED_RECOVERY_BUILD_PROP_TARGET := $(TARGET_RECOVERY_ROOT_OUT)/prop.default
|
|||
|
||||
$(INSTALLED_RECOVERY_BUILD_PROP_TARGET): PRIVATE_RECOVERY_UI_PROPERTIES := \
|
||||
TARGET_RECOVERY_UI_ANIMATION_FPS:animation_fps \
|
||||
TARGET_RECOVERY_UI_BLANK_UNBLANK_ON_INIT:blank_unblank_on_init \
|
||||
TARGET_RECOVERY_UI_MARGIN_HEIGHT:margin_height \
|
||||
TARGET_RECOVERY_UI_MARGIN_WIDTH:margin_width \
|
||||
TARGET_RECOVERY_UI_MENU_UNUSABLE_ROWS:menu_unusable_rows \
|
||||
|
@ -2702,7 +2724,12 @@ ifndef BOARD_RECOVERY_MKBOOTIMG_ARGS
|
|||
BOARD_RECOVERY_MKBOOTIMG_ARGS := $(BOARD_MKBOOTIMG_ARGS)
|
||||
endif
|
||||
|
||||
$(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP): $(MKBOOTFS) $(COMPRESSION_COMMAND_DEPS) \
|
||||
ifeq ($(strip $(BOARD_KERNEL_SEPARATED_DT)),true)
|
||||
INTERNAL_RECOVERYIMAGE_ARGS += --dt $(INSTALLED_DTIMAGE_TARGET)
|
||||
RECOVERYIMAGE_EXTRA_DEPS := $(INSTALLED_DTIMAGE_TARGET)
|
||||
endif
|
||||
|
||||
$(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP): $(MKBOOTFS) \
|
||||
$(INTERNAL_ROOT_FILES) \
|
||||
$(INSTALLED_RAMDISK_TARGET) \
|
||||
$(INTERNAL_RECOVERYIMAGE_FILES) \
|
||||
|
@ -2710,7 +2737,7 @@ $(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP): $(MKBOOTFS) $(COMPRESSION_COMMAND_
|
|||
$(INSTALLED_2NDBOOTLOADER_TARGET) \
|
||||
$(INSTALLED_RECOVERY_BUILD_PROP_TARGET) \
|
||||
$(INSTALLED_RECOVERY_RAMDISK_BUILD_PROP_TARGET) \
|
||||
$(recovery_resource_deps) \
|
||||
$(recovery_resource_deps) $(recovery_root_deps) \
|
||||
$(recovery_fstab)
|
||||
# Making recovery image
|
||||
mkdir -p $(TARGET_RECOVERY_OUT)
|
||||
|
@ -2729,10 +2756,12 @@ $(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP): $(MKBOOTFS) $(COMPRESSION_COMMAND_
|
|||
$(foreach recovery_text_file,$(generated_recovery_text_files), \
|
||||
cp -rf $(recovery_text_file) $(TARGET_RECOVERY_ROOT_OUT)/res/images/ &&) true
|
||||
cp -f $(recovery_font) $(TARGET_RECOVERY_ROOT_OUT)/res/images/font.png
|
||||
$(foreach item,$(recovery_root_private), \
|
||||
cp -rf $(item) $(TARGET_RECOVERY_OUT)/;)
|
||||
$(foreach item,$(TARGET_PRIVATE_RES_DIRS), \
|
||||
cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/$(newline))
|
||||
cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/$(newline);)
|
||||
$(foreach item,$(recovery_fstab), \
|
||||
cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.fstab)
|
||||
cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.fstab;)
|
||||
$(if $(strip $(recovery_wipe)), \
|
||||
cp -f $(recovery_wipe) $(TARGET_RECOVERY_ROOT_OUT)/system/etc/recovery.wipe)
|
||||
ln -sf prop.default $(TARGET_RECOVERY_ROOT_OUT)/default.prop
|
||||
|
@ -2741,8 +2770,13 @@ $(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP): $(MKBOOTFS) $(COMPRESSION_COMMAND_
|
|||
$(BOARD_RECOVERY_IMAGE_PREPARE)
|
||||
$(hide) touch $@
|
||||
|
||||
$(recovery_ramdisk): $(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP)
|
||||
$(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RECOVERY_ROOT_OUT) | $(COMPRESSION_COMMAND) > $(recovery_ramdisk)
|
||||
$(recovery_uncompressed_ramdisk): $(INTERNAL_RECOVERY_RAMDISK_FILES_TIMESTAMP)
|
||||
@echo ----- Making uncompressed recovery ramdisk ------
|
||||
$(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RECOVERY_ROOT_OUT) > $@
|
||||
|
||||
$(recovery_ramdisk): $(recovery_uncompressed_ramdisk) $(COMPRESSION_COMMAND_DEPS)
|
||||
@echo ----- Making compressed recovery ramdisk ------
|
||||
$(COMPRESSION_COMMAND) < $(recovery_uncompressed_ramdisk) > $@
|
||||
|
||||
# $(1): output file
|
||||
# $(2): optional kernel file
|
||||
|
@ -2798,9 +2832,13 @@ $(call declare-container-license-deps,$(INSTALLED_BOOTIMAGE_TARGET),$(recoveryim
|
|||
UNMOUNTED_NOTICE_VENDOR_DEPS+= $(INSTALLED_BOOTIMAGE_TARGET)
|
||||
endif # BOARD_USES_RECOVERY_AS_BOOT
|
||||
|
||||
$(INSTALLED_RECOVERYIMAGE_TARGET): $(recoveryimage-deps)
|
||||
ifndef BOARD_CUSTOM_BOOTIMG_MK
|
||||
$(INSTALLED_RECOVERYIMAGE_TARGET): $(recoveryimage-deps) $(RECOVERYIMAGE_EXTRA_DEPS)
|
||||
$(call build-recoveryimage-target, $@, \
|
||||
$(if $(filter true, $(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE)),, $(recovery_kernel)))
|
||||
else
|
||||
INTERNAL_RECOVERYIMAGE_ARGS += --kernel $(recovery_kernel)
|
||||
endif # BOARD_CUSTOM_BOOTIMG_MK
|
||||
|
||||
ifdef RECOVERY_RESOURCE_ZIP
|
||||
$(RECOVERY_RESOURCE_ZIP): $(INSTALLED_RECOVERYIMAGE_TARGET) | $(ZIPTIME)
|
||||
|
@ -2836,6 +2874,9 @@ ifneq ($(BOARD_NAND_SPARE_SIZE),)
|
|||
$(error MTD device is no longer supported and thus BOARD_NAND_SPARE_SIZE is deprecated.)
|
||||
endif
|
||||
|
||||
ifdef BOARD_CUSTOM_BOOTIMG_MK
|
||||
include $(BOARD_CUSTOM_BOOTIMG_MK)
|
||||
endif
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# Build debug ramdisk and debug boot image.
|
||||
|
@ -3423,12 +3464,14 @@ endef
|
|||
# $(2): The partition's staging directory
|
||||
# $(3): Files to include in the partition
|
||||
define write-partition-file-list
|
||||
$(1): PRIVATE_FILES := $(subst $(2)/,,$(filter $(2)/%,$(3)))
|
||||
$(1): PRIVATE_EXTRA_INSTALL_ZIPS := $(call relevant-extra-install-zips,$(filter $(2)/%,$(3)))
|
||||
$(1): $$(HOST_OUT_EXECUTABLES)/extra_install_zips_file_list $(foreach p,$(call relevant-extra-install-zips,$(filter $(2)/%,$(3))),$(call word-colon,3,$(p)))
|
||||
@echo Writing $$@
|
||||
rm -f $$@
|
||||
echo -n > $$@
|
||||
$$(foreach f,$(subst $(2)/,,$(filter $(2)/%,$(3))),echo "$$(f)" >> $$@$$(newline))
|
||||
$$(HOST_OUT_EXECUTABLES)/extra_install_zips_file_list $(2) $(call relevant-extra-install-zips,$(filter $(2)/%,$(3))) >> $$@
|
||||
$$(foreach f,$$(PRIVATE_FILES),echo "$$(f)" >> $$@$$(newline))
|
||||
$$(HOST_OUT_EXECUTABLES)/extra_install_zips_file_list $(2) $$(PRIVATE_EXTRA_INSTALL_ZIPS) >> $$@
|
||||
endef
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
|
@ -3523,7 +3566,8 @@ INSTALLED_SYSTEMIMAGE := $(INSTALLED_SYSTEMIMAGE_TARGET)
|
|||
ifneq ($(INSTALLED_BOOTIMAGE_TARGET),)
|
||||
ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
|
||||
ifneq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true)
|
||||
ifneq (,$(filter true,$(BOARD_INCLUDE_RECOVERY_DTBO) $(BOARD_INCLUDE_RECOVERY_ACPIO)))
|
||||
ifneq (,$(filter true,$(BOARD_INCLUDE_RECOVERY_DTBO) $(BOARD_INCLUDE_RECOVERY_ACPIO) \
|
||||
$(BOARD_RAMDISK_USE_LZ4) $(BOARD_RAMDISK_USE_XZ)))
|
||||
diff_tool := $(HOST_OUT_EXECUTABLES)/bsdiff
|
||||
else
|
||||
diff_tool := $(HOST_OUT_EXECUTABLES)/imgdiff
|
||||
|
@ -5844,6 +5888,9 @@ endif
|
|||
ifeq ($(BOARD_RAMDISK_USE_LZ4),true)
|
||||
echo "lz4_ramdisks=true" >> $@
|
||||
endif
|
||||
ifeq ($(BOARD_RAMDISK_USE_XZ),true)
|
||||
echo "xz_ramdisks=true" >> $@
|
||||
endif
|
||||
ifneq ($(INSTALLED_VENDOR_BOOTIMAGE_TARGET),)
|
||||
echo "vendor_boot=true" >> $@
|
||||
echo "vendor_boot_size=$(BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE)" >> $@
|
||||
|
@ -5898,6 +5945,9 @@ endif
|
|||
ifeq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true)
|
||||
$(hide) echo "full_recovery_image=true" >> $@
|
||||
endif
|
||||
ifdef BUILDING_VENDOR_IMAGE
|
||||
$(hide) echo "board_builds_vendorimage=true" >> $@
|
||||
endif
|
||||
ifdef BOARD_USES_VENDORIMAGE
|
||||
$(hide) echo "board_uses_vendorimage=true" >> $@
|
||||
endif
|
||||
|
@ -6043,6 +6093,9 @@ endif
|
|||
ifeq ($(BUILDING_WITH_VSDK),true)
|
||||
$(hide) echo "building_with_vsdk=true" >> $@
|
||||
endif
|
||||
ifneq ($(TARGET_OTA_ASSERT_DEVICE),)
|
||||
$(hide) echo "ota_override_device=$(TARGET_OTA_ASSERT_DEVICE)" >> $@
|
||||
endif
|
||||
|
||||
$(call declare-0p-target,$(INSTALLED_FASTBOOT_INFO_TARGET))
|
||||
|
||||
|
@ -6296,6 +6349,10 @@ ifdef BUILDING_VENDOR_BOOT_IMAGE
|
|||
endif
|
||||
endif
|
||||
|
||||
ifdef BUILDING_VENDOR_KERNEL_BOOT_IMAGE
|
||||
$(BUILT_TARGET_FILES_PACKAGE): $(INSTALLED_FILES_FILE_VENDOR_KERNEL_RAMDISK)
|
||||
endif
|
||||
|
||||
ifdef BUILDING_RECOVERY_IMAGE
|
||||
# TODO(b/30414428): Can't depend on INTERNAL_RECOVERYIMAGE_FILES alone like other
|
||||
# BUILT_TARGET_FILES_PACKAGE dependencies because currently there're cp/rsync/rm
|
||||
|
@ -6406,6 +6463,7 @@ $(BUILT_TARGET_FILES_DIR): \
|
|||
$(INSTALLED_PVMFW_EMBEDDED_AVBKEY_TARGET) \
|
||||
$(INSTALLED_CUSTOMIMAGES_TARGET) \
|
||||
$(INSTALLED_ANDROID_INFO_TXT_TARGET) \
|
||||
$(INSTALLED_RECOVERY_KERNEL_TARGET) \
|
||||
$(INSTALLED_KERNEL_TARGET) \
|
||||
$(INSTALLED_RAMDISK_TARGET) \
|
||||
$(INSTALLED_DTBIMAGE_TARGET) \
|
||||
|
@ -6449,12 +6507,12 @@ ifneq (true,$(BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT))
|
|||
$(hide) $(call package_files-copy-root, \
|
||||
$(TARGET_RECOVERY_ROOT_OUT),$(zip_root)/$(PRIVATE_RECOVERY_OUT)/RAMDISK)
|
||||
endif
|
||||
ifdef INSTALLED_KERNEL_TARGET
|
||||
ifneq (,$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)))
|
||||
cp $(INSTALLED_KERNEL_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/
|
||||
else ifneq (true,$(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE))
|
||||
cp $(firstword $(INSTALLED_KERNEL_TARGET)) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/kernel
|
||||
endif
|
||||
@# OTA install helpers
|
||||
$(hide) $(call package_files-copy-root, \
|
||||
$(PRODUCT_OUT)/install,$(zip_root)/INSTALL)
|
||||
ifdef INSTALLED_RECOVERY_KERNEL_TARGET
|
||||
# The python script that wraps it all up wants it to be named kernel, so do that
|
||||
cp $(INSTALLED_RECOVERY_KERNEL_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/kernel
|
||||
endif
|
||||
ifneq (truetrue,$(strip $(BUILDING_VENDOR_BOOT_IMAGE))$(strip $(BOARD_USES_RECOVERY_AS_BOOT)))
|
||||
ifdef INSTALLED_2NDBOOTLOADER_TARGET
|
||||
|
@ -6484,6 +6542,9 @@ endif
|
|||
ifdef BOARD_KERNEL_PAGESIZE
|
||||
echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/$(PRIVATE_RECOVERY_OUT)/pagesize
|
||||
endif
|
||||
ifeq ($(strip $(BOARD_KERNEL_SEPARATED_DT)),true)
|
||||
$(hide) $(ACP) $(INSTALLED_DTIMAGE_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/dt
|
||||
endif
|
||||
endif # not (BUILDING_VENDOR_BOOT_IMAGE and BOARD_USES_RECOVERY_AS_BOOT)
|
||||
endif # INSTALLED_RECOVERYIMAGE_TARGET defined or BOARD_USES_RECOVERY_AS_BOOT is true
|
||||
@# Components of the boot image
|
||||
|
@ -6514,6 +6575,9 @@ endif
|
|||
ifdef BOARD_KERNEL_PAGESIZE
|
||||
echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/BOOT/pagesize
|
||||
endif
|
||||
ifeq ($(strip $(BOARD_KERNEL_SEPARATED_DT)),true)
|
||||
$(hide) $(ACP) $(INSTALLED_DTIMAGE_TARGET) $(zip_root)/BOOT/dt
|
||||
endif
|
||||
endif # INSTALLED_VENDOR_BOOTIMAGE_TARGET == "" && BOARD_USES_GENERIC_KERNEL_IMAGE != true
|
||||
endif # BOARD_USES_RECOVERY_AS_BOOT not true
|
||||
$(hide) $(foreach t,$(INSTALLED_RADIOIMAGE_TARGET),\
|
||||
|
@ -6563,6 +6627,14 @@ ifdef BOARD_KERNEL_PAGESIZE
|
|||
echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/VENDOR_KERNEL_BOOT/pagesize
|
||||
endif
|
||||
endif # INSTALLED_VENDOR_BOOTIMAGE_TARGET
|
||||
ifdef BOARD_CUSTOM_BOOTIMG
|
||||
@# Prebuilt boot images
|
||||
$(hide) mkdir -p $(zip_root)/BOOTABLE_IMAGES
|
||||
$(hide) $(ACP) $(INSTALLED_BOOTIMAGE_TARGET) $(zip_root)/BOOTABLE_IMAGES/
|
||||
ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
|
||||
$(hide) $(ACP) $(INSTALLED_RECOVERYIMAGE_TARGET) $(zip_root)/BOOTABLE_IMAGES/
|
||||
endif
|
||||
endif
|
||||
ifdef BUILDING_SYSTEM_IMAGE
|
||||
@# Contents of the system image
|
||||
$(hide) $(call package_files-copy-root, \
|
||||
|
@ -6936,6 +7008,7 @@ PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$(dir $(ZIP2ZIP)):$$PATH \
|
|||
$(OTA_FROM_TARGET_FILES) \
|
||||
--verbose \
|
||||
--path $(HOST_OUT) \
|
||||
--backup=$(backuptool) \
|
||||
$(if $(OEM_OTA_CONFIG), --oem_settings $(OEM_OTA_CONFIG)) \
|
||||
$(if $(BOOT_VAR_OTA_CONFIG), --boot_variable_file $(BOOT_VAR_OTA_CONFIG)) \
|
||||
$(2) \
|
||||
|
@ -6953,6 +7026,16 @@ INTERNAL_OTA_METADATA := $(PRODUCT_OUT)/ota_metadata
|
|||
|
||||
$(call declare-0p-target,$(INTERNAL_OTA_METADATA))
|
||||
|
||||
ifeq ($(TARGET_BUILD_VARIANT),user)
|
||||
$(INTERNAL_OTA_PACKAGE_TARGET): backuptool := false
|
||||
else
|
||||
ifneq ($(TEQUILA_BUILD),)
|
||||
$(INTERNAL_OTA_PACKAGE_TARGET): backuptool := true
|
||||
else
|
||||
$(INTERNAL_OTA_PACKAGE_TARGET): backuptool := false
|
||||
endif
|
||||
endif
|
||||
|
||||
$(INTERNAL_OTA_PACKAGE_TARGET): KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR)
|
||||
$(INTERNAL_OTA_PACKAGE_TARGET): .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_OTA_METADATA)
|
||||
$(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_DIR) $(OTA_FROM_TARGET_FILES) $(INTERNAL_OTATOOLS_FILES)
|
||||
|
@ -7311,7 +7394,7 @@ ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION))
|
|||
# BOARD_SUPER_PARTITION_SIZE must be defined to build super image.
|
||||
ifneq ($(BOARD_SUPER_PARTITION_SIZE),)
|
||||
|
||||
ifneq (true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS))
|
||||
ifeq ($(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)),1)
|
||||
|
||||
# For real devices and for dist builds, build super image from target files to an intermediate directory.
|
||||
INTERNAL_SUPERIMAGE_DIST_TARGET := $(call intermediates-dir-for,PACKAGING,super.img)/super.img
|
||||
|
@ -7329,7 +7412,7 @@ endif
|
|||
.PHONY: superimage_dist
|
||||
superimage_dist: $(INTERNAL_SUPERIMAGE_DIST_TARGET)
|
||||
|
||||
endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS != "true"
|
||||
endif # $(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)) == 1
|
||||
endif # BOARD_SUPER_PARTITION_SIZE != ""
|
||||
endif # PRODUCT_BUILD_SUPER_PARTITION == "true"
|
||||
|
||||
|
@ -7338,7 +7421,7 @@ endif # PRODUCT_BUILD_SUPER_PARTITION == "true"
|
|||
|
||||
ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION))
|
||||
ifneq ($(BOARD_SUPER_PARTITION_SIZE),)
|
||||
ifneq (true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS))
|
||||
ifeq ($(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)),1)
|
||||
|
||||
# Build super.img by using $(INSTALLED_*IMAGE_TARGET) to $(1)
|
||||
# $(1): built image path
|
||||
|
@ -7393,7 +7476,7 @@ superimage-nodeps supernod: | $(INSTALLED_SUPERIMAGE_DEPENDENCIES)
|
|||
$(call build-superimage-target,$(INSTALLED_SUPERIMAGE_TARGET),\
|
||||
$(call intermediates-dir-for,PACKAGING,superimage-nodeps)/misc_info.txt)
|
||||
|
||||
endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS != "true"
|
||||
endif # $(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)) == 1
|
||||
endif # BOARD_SUPER_PARTITION_SIZE != ""
|
||||
endif # PRODUCT_BUILD_SUPER_PARTITION == "true"
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ $(call add_soong_config_namespace,ANDROID)
|
|||
$(call add_soong_config_var,ANDROID,BOARD_USES_ODMIMAGE)
|
||||
$(call add_soong_config_var,ANDROID,BOARD_USES_RECOVERY_AS_BOOT)
|
||||
$(call add_soong_config_var,ANDROID,CHECK_DEV_TYPE_VIOLATIONS)
|
||||
$(call add_soong_config_var,ANDROID,PLATFORM_SEPOLICY_VERSION)
|
||||
$(call add_soong_config_var,ANDROID,PLATFORM_SEPOLICY_COMPAT_VERSIONS)
|
||||
$(call add_soong_config_var,ANDROID,PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT)
|
||||
$(call add_soong_config_var,ANDROID,TARGET_DYNAMIC_64_32_DRMSERVER)
|
||||
|
@ -36,7 +37,7 @@ $(call add_soong_config_var,ANDROID,TARGET_ENABLE_MEDIADRM_64)
|
|||
$(call add_soong_config_var,ANDROID,TARGET_DYNAMIC_64_32_MEDIASERVER)
|
||||
|
||||
# PRODUCT_PRECOMPILED_SEPOLICY defaults to true. Explicitly check if it's "false" or not.
|
||||
$(call add_soong_config_var_value,ANDROID,PRODUCT_PRECOMPILED_SEPOLICY,$(if $(filter false,$(PRODUCT_PRECOMPILED_SEPOLICY)),false,true))
|
||||
$(call soong_config_set_bool,ANDROID,PRODUCT_PRECOMPILED_SEPOLICY,$(if $(filter false,$(PRODUCT_PRECOMPILED_SEPOLICY)),false,true))
|
||||
|
||||
ifdef ART_DEBUG_OPT_FLAG
|
||||
$(call soong_config_set,art_module,art_debug_opt_flag,$(ART_DEBUG_OPT_FLAG))
|
||||
|
|
|
@ -44,6 +44,33 @@ endif
|
|||
|
||||
my_soong_problems :=
|
||||
|
||||
# Automatically replace the old-style kernel header include with a dependency
|
||||
# on the generated_kernel_headers header library when building inline
|
||||
ifeq ($(INLINE_KERNEL_BUILDING),true)
|
||||
ifneq (,$(findstring $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include,$(LOCAL_C_INCLUDES)))
|
||||
LOCAL_C_INCLUDES := $(patsubst $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include,,$(LOCAL_C_INCLUDES))
|
||||
LOCAL_HEADER_LIBRARIES += generated_kernel_headers
|
||||
endif
|
||||
|
||||
# Some qcom binaries use this weird -isystem include...
|
||||
ifneq (,$(findstring $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include,$(LOCAL_CFLAGS)))
|
||||
LOCAL_CFLAGS := $(patsubst -isystem $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include,,$(LOCAL_CFLAGS))
|
||||
LOCAL_HEADER_LIBRARIES += generated_kernel_headers
|
||||
endif
|
||||
|
||||
# Remove KERNEL_OBJ/usr from any LOCAL_ADDITIONAL_DEPENDENCIES, we will
|
||||
# just include generated_kernel_headers which already has the proper
|
||||
# dependency
|
||||
ifneq (,$(findstring $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr,$(LOCAL_ADDITIONAL_DEPENDENCIES)))
|
||||
LOCAL_ADDITIONAL_DEPENDENCIES := $(patsubst $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr,,$(LOCAL_ADDITIONAL_DEPENDENCIES))
|
||||
endif
|
||||
|
||||
# Replace device_kernel_headers with generated_kernel_headers
|
||||
ifneq (,$(findstring device_kernel_headers,$(LOCAL_HEADER_LIBRARIES)))
|
||||
LOCAL_HEADER_LIBRARIES := $(patsubst device_kernel_headers,generated_kernel_headers,$(LOCAL_HEADER_LIBRARIES))
|
||||
endif
|
||||
endif
|
||||
|
||||
# The following LOCAL_ variables will be modified in this file.
|
||||
# Because the same LOCAL_ variables may be used to define modules for both 1st arch and 2nd arch,
|
||||
# we can't modify them in place.
|
||||
|
@ -1407,6 +1434,11 @@ my_tracked_gen_files :=
|
|||
$(foreach f,$(my_tracked_src_files),$(eval my_src_file_obj_$(s):=))
|
||||
my_tracked_src_files :=
|
||||
|
||||
## Allow a device's own headers to take precedence over global ones
|
||||
ifneq ($(TARGET_SPECIFIC_HEADER_PATH),)
|
||||
my_c_includes := $(TOPDIR)$(TARGET_SPECIFIC_HEADER_PATH) $(my_c_includes)
|
||||
endif
|
||||
|
||||
my_c_includes += $(TOPDIR)$(LOCAL_PATH) $(intermediates) $(generated_sources_dir)
|
||||
|
||||
my_c_includes := $(foreach inc,$(my_c_includes),$(call clean-path,$(inc)))
|
||||
|
|
|
@ -316,6 +316,19 @@ $(call soong_config_define_internal,$1,$2) \
|
|||
$(eval SOONG_CONFIG_$(strip $1)_$(strip $2):=$(strip $3))
|
||||
endef
|
||||
|
||||
# soong_config_set_bool is the same as soong_config_set, but it will
|
||||
# also type the variable as a bool, so that when using select() expressions
|
||||
# in blueprint files they can use boolean values instead of strings.
|
||||
# It will only accept "true" for its value, any other value will be
|
||||
# treated as false.
|
||||
# $1 is the namespace. $2 is the variable name. $3 is the variable value.
|
||||
# Ex: $(call soong_config_set_bool,acme,COOL_FEATURE,true)
|
||||
define soong_config_set_bool
|
||||
$(call soong_config_define_internal,$1,$2) \
|
||||
$(eval SOONG_CONFIG_$(strip $1)_$(strip $2):=$(filter true,$3))
|
||||
$(eval SOONG_CONFIG_TYPE_$(strip $1)_$(strip $2):=bool)
|
||||
endef
|
||||
|
||||
# soong_config_append appends to the value of the variable in the given Soong
|
||||
# config namespace. If the variable does not exist, it will be defined. If the
|
||||
# namespace does not exist, it will be defined.
|
||||
|
@ -440,6 +453,10 @@ endif
|
|||
# See envsetup.mk for a description of SCAN_EXCLUDE_DIRS
|
||||
FIND_LEAVES_EXCLUDES := $(addprefix --prune=, $(SCAN_EXCLUDE_DIRS) .repo .git)
|
||||
|
||||
ifneq ($(TEQUILA_BUILD),)
|
||||
include vendor/tequila/config/BoardConfigtequila.mk
|
||||
endif
|
||||
|
||||
# The build system exposes several variables for where to find the kernel
|
||||
# headers:
|
||||
# TARGET_DEVICE_KERNEL_HEADERS is automatically created for the current
|
||||
|
@ -1243,21 +1260,60 @@ BUILD_WARNING_BAD_OPTIONAL_USES_LIBS_ALLOWLIST := LegacyCamera Gallery2
|
|||
# in the source tree.
|
||||
dont_bother_goals := out product-graph
|
||||
|
||||
ifeq ($(TARGET_SYSTEM_PROP),)
|
||||
TARGET_SYSTEM_PROP := $(wildcard $(TARGET_DEVICE_DIR)/system.prop)
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_SYSTEM_EXT_PROP),)
|
||||
TARGET_SYSTEM_EXT_PROP := $(wildcard $(TARGET_DEVICE_DIR)/system_ext.prop)
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_PRODUCT_PROP),)
|
||||
TARGET_PRODUCT_PROP := $(wildcard $(TARGET_DEVICE_DIR)/product.prop)
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ODM_PROP),)
|
||||
TARGET_ODM_PROP := $(wildcard $(TARGET_DEVICE_DIR)/odm.prop)
|
||||
endif
|
||||
|
||||
.KATI_READONLY := \
|
||||
TARGET_SYSTEM_PROP \
|
||||
TARGET_SYSTEM_EXT_PROP \
|
||||
TARGET_PRODUCT_PROP \
|
||||
TARGET_ODM_PROP \
|
||||
|
||||
include $(BUILD_SYSTEM)/sysprop_config.mk
|
||||
|
||||
# Make ANDROID Soong config variables visible to Android.mk files, for
|
||||
# consistency with those defined in BoardConfig.mk files.
|
||||
include $(BUILD_SYSTEM)/android_soong_config_vars.mk
|
||||
|
||||
ifneq ($(TEQUILA_BUILD),)
|
||||
ifneq ($(wildcard device/tequila/sepolicy/common/sepolicy.mk),)
|
||||
## We need to be sure the global selinux policies are included
|
||||
## last, to avoid accidental resetting by device configs
|
||||
$(eval include device/tequila/sepolicy/common/sepolicy.mk)
|
||||
endif
|
||||
endif
|
||||
|
||||
SOONG_VARIABLES := $(SOONG_OUT_DIR)/soong.$(TARGET_PRODUCT).variables
|
||||
SOONG_EXTRA_VARIABLES := $(SOONG_OUT_DIR)/soong.$(TARGET_PRODUCT).extra.variables
|
||||
|
||||
ifeq ($(CALLED_FROM_SETUP),true)
|
||||
include $(BUILD_SYSTEM)/ninja_config.mk
|
||||
include $(BUILD_SYSTEM)/soong_config.mk
|
||||
endif
|
||||
|
||||
SOONG_VARIABLES :=
|
||||
SOONG_EXTRA_VARIABLES :=
|
||||
|
||||
-include external/ltp/android/ltp_package_list.mk
|
||||
DEFAULT_DATA_OUT_MODULES := ltp $(ltp_packages)
|
||||
.KATI_READONLY := DEFAULT_DATA_OUT_MODULES
|
||||
|
||||
# Include any vendor specific config.mk file
|
||||
-include vendor/*/build/core/config.mk
|
||||
|
||||
include $(BUILD_SYSTEM)/dumpvar.mk
|
||||
|
||||
ifdef BOARD_VNDK_VERSION
|
||||
|
|
|
@ -3932,6 +3932,7 @@ $(foreach source,$(ENFORCE_RRO_SOURCES), \
|
|||
$(eval enforce_rro_partition := $(word 6,$(_o))) \
|
||||
$(eval include $(BUILD_SYSTEM)/generate_enforce_rro.mk) \
|
||||
$(eval ALL_MODULES.$$(enforce_rro_source_module).REQUIRED_FROM_TARGET += $$(LOCAL_PACKAGE_NAME)) \
|
||||
$(eval ENFORCE_RRO_PACKAGES_$$(call to-upper,$(enforce_rro_partition)) += $$(LOCAL_PACKAGE_NAME)) \
|
||||
)
|
||||
endef
|
||||
|
||||
|
|
18
core/main.mk
18
core/main.mk
|
@ -252,6 +252,8 @@ $(readonly-final-product-vars)
|
|||
|
||||
ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),)
|
||||
ENFORCE_RRO_SOURCES :=
|
||||
ENFORCE_RRO_PACKAGES_PRODUCT :=
|
||||
ENFORCE_RRO_PACKAGES_VENDOR :=
|
||||
endif
|
||||
|
||||
# Color-coded warnings including current module info
|
||||
|
@ -325,6 +327,22 @@ endef
|
|||
# -------------------------------------------------------------------
|
||||
ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),)
|
||||
$(call generate_all_enforce_rro_packages)
|
||||
|
||||
_modules_with_rro_suffix :=
|
||||
$(foreach m,$(PRODUCT_PACKAGES), \
|
||||
$(eval _modules_with_rro_suffix += $$(m)__$(PRODUCT_NAME)__auto_generated_rro_%))
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := enforce_rro_packages_product
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_REQUIRED_MODULES := $(filter $(_modules_with_rro_suffix),$(ENFORCE_RRO_PACKAGES_PRODUCT))
|
||||
include $(BUILD_PHONY_PACKAGE)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := enforce_rro_packages_vendor
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_REQUIRED_MODULES := $(filter $(_modules_with_rro_suffix),$(ENFORCE_RRO_PACKAGES_VENDOR))
|
||||
include $(BUILD_PHONY_PACKAGE)
|
||||
endif
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
|
|
|
@ -92,3 +92,5 @@ FRAMEWORKS_BASE_SUBDIRS := \
|
|||
#
|
||||
FRAMEWORKS_BASE_JAVA_SRC_DIRS := \
|
||||
$(addprefix frameworks/base/,$(FRAMEWORKS_BASE_SUBDIRS))
|
||||
|
||||
-include vendor/tequila/build/core/pathmap.mk
|
||||
|
|
|
@ -550,12 +550,15 @@ endef
|
|||
|
||||
# Makes including non-existent modules in PRODUCT_PACKAGES an error.
|
||||
# $(1): list of non-existent modules to allow.
|
||||
define enforce-product-packages-exist-internal
|
||||
$(eval PRODUCTS.$(1).PRODUCT_ENFORCE_PACKAGES_EXIST := true) \
|
||||
$(eval PRODUCTS.$(1).PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST := $(2)) \
|
||||
$(eval .KATI_READONLY := PRODUCTS.$(1).PRODUCT_ENFORCE_PACKAGES_EXIST) \
|
||||
$(eval .KATI_READONLY := PRODUCTS.$(1).PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST)
|
||||
endef
|
||||
define enforce-product-packages-exist
|
||||
$(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
|
||||
$(eval PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST := true) \
|
||||
$(eval PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST := $(1)) \
|
||||
$(eval .KATI_READONLY := PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST) \
|
||||
$(eval .KATI_READONLY := PRODUCTS.$(current_mk).PRODUCT_ENFORCE_PACKAGES_EXIST_ALLOW_LIST)
|
||||
$(enforce-product-packages-exist-internal,$(current_mk),$(1))
|
||||
endef
|
||||
|
||||
#
|
||||
|
@ -597,9 +600,11 @@ _readonly_late_variables := \
|
|||
|
||||
# Modified internally in the build system
|
||||
_readonly_late_variables += \
|
||||
PRODUCT_CFI_INCLUDE_PATHS \
|
||||
PRODUCT_COPY_FILES \
|
||||
PRODUCT_DEX_PREOPT_NEVER_ALLOW_STRIPPING \
|
||||
PRODUCT_DEX_PREOPT_BOOT_FLAGS \
|
||||
PRODUCT_SOONG_NAMESPACES
|
||||
|
||||
_readonly_early_variables := $(filter-out $(_readonly_late_variables),$(_product_var_list))
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
SOONG_MAKEVARS_MK := $(SOONG_OUT_DIR)/make_vars-$(TARGET_PRODUCT).mk
|
||||
SOONG_VARIABLES := $(SOONG_OUT_DIR)/soong.$(TARGET_PRODUCT).variables
|
||||
SOONG_ANDROID_MK := $(SOONG_OUT_DIR)/Android-$(TARGET_PRODUCT).mk
|
||||
|
||||
include $(BUILD_SYSTEM)/art_config.mk
|
||||
|
@ -30,6 +29,7 @@ $(call json_start)
|
|||
$(call add_json_str, Make_suffix, -$(TARGET_PRODUCT))
|
||||
|
||||
$(call add_json_str, BuildId, $(BUILD_ID))
|
||||
$(call add_json_str, BuildFingerprintFile, build_fingerprint.txt)
|
||||
$(call add_json_str, BuildNumberFile, build_number.txt)
|
||||
$(call add_json_str, BuildHostnameFile, build_hostname.txt)
|
||||
$(call add_json_str, BuildThumbprintFile, build_thumbprint.txt)
|
||||
|
@ -147,12 +147,16 @@ $(call add_json_list, NativeCoverageExcludePaths, $(NATIVE_COVERAGE_EXCLU
|
|||
$(call add_json_bool, ArtUseReadBarrier, $(call invert_bool,$(filter false,$(PRODUCT_ART_USE_READ_BARRIER))))
|
||||
$(call add_json_str, BtConfigIncludeDir, $(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR))
|
||||
$(call add_json_list, DeviceKernelHeaders, $(TARGET_DEVICE_KERNEL_HEADERS) $(TARGET_BOARD_KERNEL_HEADERS) $(TARGET_PRODUCT_KERNEL_HEADERS))
|
||||
$(call add_json_str, TargetSpecificHeaderPath, $(TARGET_SPECIFIC_HEADER_PATH))
|
||||
$(call add_json_str, VendorApiLevel, $(BOARD_API_LEVEL))
|
||||
$(call add_json_list, ExtraVndkVersions, $(PRODUCT_EXTRA_VNDK_VERSIONS))
|
||||
$(call add_json_list, DeviceSystemSdkVersions, $(BOARD_SYSTEMSDK_VERSIONS))
|
||||
$(call add_json_str, RecoverySnapshotVersion, $(RECOVERY_SNAPSHOT_VERSION))
|
||||
$(call add_json_list, Platform_systemsdk_versions, $(PLATFORM_SYSTEMSDK_VERSIONS))
|
||||
$(call add_json_bool, Malloc_low_memory, $(findstring true,$(MALLOC_SVELTE) $(MALLOC_LOW_MEMORY)))
|
||||
$(call add_json_bool, Malloc_low_memory_libc32, $(if $(MALLOC_SVELTE_FOR_LIBC32),\
|
||||
$(filter true,$(MALLOC_SVELTE_FOR_LIBC32)),\
|
||||
$(findstring true,$(MALLOC_SVELTE) $(MALLOC_LOW_MEMORY))))
|
||||
$(call add_json_bool, Malloc_zero_contents, $(call invert_bool,$(filter false,$(MALLOC_ZERO_CONTENTS))))
|
||||
$(call add_json_bool, Malloc_pattern_fill_contents, $(MALLOC_PATTERN_FILL_CONTENTS))
|
||||
$(call add_json_str, Override_rs_driver, $(OVERRIDE_RS_DRIVER))
|
||||
|
@ -262,6 +266,18 @@ $(foreach namespace,$(sort $(SOONG_CONFIG_NAMESPACES)),\
|
|||
$(call end_json_map))
|
||||
$(call end_json_map)
|
||||
|
||||
# Add the types of the variables in VendorVars. Since this is much newer
|
||||
# than VendorVars, which has a history of just using string values for everything,
|
||||
# variables are assumed to be strings by default. For strings, SOONG_CONFIG_TYPE_*
|
||||
# will not be set, and they will not have an entry in the VendorVarTypes map.
|
||||
$(call add_json_map, VendorVarTypes)
|
||||
$(foreach namespace,$(sort $(SOONG_CONFIG_NAMESPACES)),\
|
||||
$(call add_json_map, $(namespace))\
|
||||
$(foreach key,$(sort $(SOONG_CONFIG_$(namespace))),\
|
||||
$(if $(SOONG_CONFIG_TYPE_$(namespace)_$(key)),$(call add_json_str,$(key),$(subst ",\",$(SOONG_CONFIG_TYPE_$(namespace)_$(key))))))\
|
||||
$(call end_json_map))
|
||||
$(call end_json_map)
|
||||
|
||||
$(call add_json_bool, EnforceProductPartitionInterface, $(filter true,$(PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE)))
|
||||
$(call add_json_str, DeviceCurrentApiLevelForVendorModules, $(BOARD_CURRENT_API_LEVEL_FOR_VENDOR_MODULES))
|
||||
|
||||
|
@ -297,6 +313,7 @@ $(call add_json_bool, BuildBrokenVendorPropertyNamespace, $(filter true,$(BUILD
|
|||
$(call add_json_bool, BuildBrokenIncorrectPartitionImages, $(filter true,$(BUILD_BROKEN_INCORRECT_PARTITION_IMAGES)))
|
||||
$(call add_json_list, BuildBrokenInputDirModules, $(BUILD_BROKEN_INPUT_DIR_MODULES))
|
||||
$(call add_json_bool, BuildBrokenDontCheckSystemSdk, $(filter true,$(BUILD_BROKEN_DONT_CHECK_SYSTEMSDK)))
|
||||
$(call add_json_bool, BuildBrokenDupSysprop, $(filter true,$(BUILD_BROKEN_DUP_SYSPROP)))
|
||||
|
||||
$(call add_json_list, BuildWarningBadOptionalUsesLibsAllowlist, $(BUILD_WARNING_BAD_OPTIONAL_USES_LIBS_ALLOWLIST))
|
||||
|
||||
|
@ -346,6 +363,22 @@ $(call add_json_bool, BoardUseVbmetaDigestInFingerprint, $(filter true,$(BOARD_U
|
|||
|
||||
$(call add_json_list, OemProperties, $(PRODUCT_OEM_PROPERTIES))
|
||||
|
||||
$(call add_json_list, SystemPropFiles, $(TARGET_SYSTEM_PROP))
|
||||
$(call add_json_list, SystemExtPropFiles, $(TARGET_SYSTEM_EXT_PROP))
|
||||
$(call add_json_list, ProductPropFiles, $(TARGET_PRODUCT_PROP))
|
||||
$(call add_json_list, OdmPropFiles, $(TARGET_ODM_PROP))
|
||||
|
||||
# Do not set ArtTargetIncludeDebugBuild into any value if PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD is not set,
|
||||
# to have the same behavior from runtime_libart.mk.
|
||||
ifneq ($(PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD),)
|
||||
$(call add_json_bool, ArtTargetIncludeDebugBuild, $(PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD))
|
||||
endif
|
||||
|
||||
_config_enable_uffd_gc := \
|
||||
$(firstword $(OVERRIDE_ENABLE_UFFD_GC) $(PRODUCT_ENABLE_UFFD_GC) default)
|
||||
$(call add_json_str, EnableUffdGc, $(_config_enable_uffd_gc))
|
||||
_config_enable_uffd_gc :=
|
||||
|
||||
$(call json_end)
|
||||
|
||||
$(file >$(SOONG_VARIABLES).tmp,$(json_contents))
|
||||
|
@ -356,4 +389,6 @@ $(shell if ! cmp -s $(SOONG_VARIABLES).tmp $(SOONG_VARIABLES); then \
|
|||
rm $(SOONG_VARIABLES).tmp; \
|
||||
fi)
|
||||
|
||||
include $(BUILD_SYSTEM)/soong_extra_config.mk
|
||||
|
||||
endif # CONFIGURE_SOONG
|
||||
|
|
108
core/soong_extra_config.mk
Normal file
108
core/soong_extra_config.mk
Normal file
|
@ -0,0 +1,108 @@
|
|||
$(call json_start)
|
||||
|
||||
$(call add_json_str, DeviceCpuVariantRuntime, $(TARGET_CPU_VARIANT_RUNTIME))
|
||||
$(call add_json_str, DeviceAbiList, $(TARGET_CPU_ABI_LIST))
|
||||
$(call add_json_str, DeviceAbiList32, $(TARGET_CPU_ABI_LIST_32_BIT))
|
||||
$(call add_json_str, DeviceAbiList64, $(TARGET_CPU_ABI_LIST_64_BIT))
|
||||
$(call add_json_str, DeviceSecondaryCpuVariantRuntime, $(TARGET_2ND_CPU_VARIANT_RUNTIME))
|
||||
|
||||
$(call add_json_str, Dex2oatTargetCpuVariantRuntime, $(DEX2OAT_TARGET_CPU_VARIANT_RUNTIME))
|
||||
$(call add_json_str, Dex2oatTargetInstructionSetFeatures, $(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES))
|
||||
$(call add_json_str, SecondaryDex2oatCpuVariantRuntime, $($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT_RUNTIME))
|
||||
$(call add_json_str, SecondaryDex2oatInstructionSetFeatures, $($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES))
|
||||
|
||||
$(call add_json_str, BoardPlatform, $(TARGET_BOARD_PLATFORM))
|
||||
$(call add_json_str, BoardShippingApiLevel, $(BOARD_SHIPPING_API_LEVEL))
|
||||
$(call add_json_str, ShippingApiLevel, $(PRODUCT_SHIPPING_API_LEVEL))
|
||||
$(call add_json_str, ShippingVendorApiLevel, $(PRODUCT_SHIPPING_VENDOR_API_LEVEL))
|
||||
|
||||
$(call add_json_str, ProductModel, $(PRODUCT_MODEL))
|
||||
$(call add_json_str, ProductModelForAttestation, $(PRODUCT_MODEL_FOR_ATTESTATION))
|
||||
$(call add_json_str, ProductBrandForAttestation, $(PRODUCT_BRAND_FOR_ATTESTATION))
|
||||
$(call add_json_str, ProductNameForAttestation, $(PRODUCT_NAME_FOR_ATTESTATION))
|
||||
$(call add_json_str, ProductDeviceForAttestation, $(PRODUCT_DEVICE_FOR_ATTESTATION))
|
||||
$(call add_json_str, ProductManufacturerForAttestation, $(PRODUCT_MANUFACTURER_FOR_ATTESTATION))
|
||||
|
||||
$(call add_json_str, SystemBrand, $(PRODUCT_SYSTEM_BRAND))
|
||||
$(call add_json_str, SystemDevice, $(PRODUCT_SYSTEM_DEVICE))
|
||||
$(call add_json_str, SystemManufacturer, $(PRODUCT_SYSTEM_MANUFACTURER))
|
||||
$(call add_json_str, SystemModel, $(PRODUCT_SYSTEM_MODEL))
|
||||
$(call add_json_str, SystemName, $(PRODUCT_SYSTEM_NAME))
|
||||
|
||||
# Collapses ?= and = operators for system property variables. Also removes double quotes to prevent
|
||||
# malformed JSON. This change aligns with the existing behavior of sysprop.mk, which passes property
|
||||
# variables to the echo command, effectively discarding surrounding double quotes.
|
||||
define collapse-prop-pairs
|
||||
$(subst ",,$(call collapse-pairs,$(call collapse-pairs,$$($(1)),?=),=))
|
||||
endef
|
||||
|
||||
$(call add_json_list, PRODUCT_SYSTEM_PROPERTIES, $(call collapse-prop-pairs,PRODUCT_SYSTEM_PROPERTIES))
|
||||
$(call add_json_list, PRODUCT_SYSTEM_DEFAULT_PROPERTIES, $(call collapse-prop-pairs,PRODUCT_SYSTEM_DEFAULT_PROPERTIES))
|
||||
$(call add_json_list, PRODUCT_SYSTEM_EXT_PROPERTIES, $(call collapse-prop-pairs,PRODUCT_SYSTEM_EXT_PROPERTIES))
|
||||
$(call add_json_list, PRODUCT_VENDOR_PROPERTIES, $(call collapse-prop-pairs,PRODUCT_VENDOR_PROPERTIES))
|
||||
$(call add_json_list, PRODUCT_PRODUCT_PROPERTIES, $(call collapse-prop-pairs,PRODUCT_PRODUCT_PROPERTIES))
|
||||
$(call add_json_list, PRODUCT_ODM_PROPERTIES, $(call collapse-prop-pairs,PRODUCT_ODM_PROPERTIES))
|
||||
$(call add_json_list, PRODUCT_PROPERTY_OVERRIDES, $(call collapse-prop-pairs,PRODUCT_PROPERTY_OVERRIDES))
|
||||
|
||||
$(call add_json_list, PRODUCT_BUILD_PROP_OVERRIDES, $(call collapse-prop-pairs,PRODUCT_BUILD_PROP_OVERRIDES))
|
||||
|
||||
$(call add_json_str, BootloaderBoardName, $(TARGET_BOOTLOADER_BOARD_NAME))
|
||||
|
||||
$(call add_json_bool, SdkBuild, $(filter sdk sdk_addon,$(MAKECMDGOALS)))
|
||||
|
||||
$(call add_json_str, SystemServerCompilerFilter, $(PRODUCT_SYSTEM_SERVER_COMPILER_FILTER))
|
||||
|
||||
$(call add_json_bool, Product16KDeveloperOption, $(filter true,$(PRODUCT_16K_DEVELOPER_OPTION)))
|
||||
|
||||
$(call add_json_str, RecoveryDefaultRotation, $(TARGET_RECOVERY_DEFAULT_ROTATION))
|
||||
$(call add_json_str, RecoveryOverscanPercent, $(TARGET_RECOVERY_OVERSCAN_PERCENT))
|
||||
$(call add_json_str, RecoveryPixelFormat, $(TARGET_RECOVERY_PIXEL_FORMAT))
|
||||
|
||||
ifdef AB_OTA_UPDATER
|
||||
$(call add_json_bool, AbOtaUpdater, $(filter true,$(AB_OTA_UPDATER)))
|
||||
$(call add_json_str, AbOtaPartitions, $(subst $(space),$(comma),$(sort $(AB_OTA_PARTITIONS))))
|
||||
endif
|
||||
|
||||
ifdef PRODUCT_USE_DYNAMIC_PARTITIONS
|
||||
$(call add_json_bool, UseDynamicPartitions, $(filter true,$(PRODUCT_USE_DYNAMIC_PARTITIONS)))
|
||||
endif
|
||||
|
||||
ifdef PRODUCT_RETROFIT_DYNAMIC_PARTITIONS
|
||||
$(call add_json_bool, RetrofitDynamicPartitions, $(filter true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS)))
|
||||
endif
|
||||
|
||||
$(call add_json_bool, DontUseVabcOta, $(filter true,$(BOARD_DONT_USE_VABC_OTA)))
|
||||
|
||||
$(call add_json_bool, FullTreble, $(filter true,$(PRODUCT_FULL_TREBLE)))
|
||||
|
||||
$(call add_json_bool, NoBionicPageSizeMacro, $(filter true,$(PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO)))
|
||||
|
||||
$(call add_json_bool, PropertySplitEnabled, $(filter true,$(BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED)))
|
||||
|
||||
$(call add_json_str, ScreenDensity, $(TARGET_SCREEN_DENSITY))
|
||||
|
||||
$(call add_json_bool, UsesVulkan, $(filter true,$(TARGET_USES_VULKAN)))
|
||||
|
||||
$(call add_json_bool, ZygoteForce64, $(filter true,$(ZYGOTE_FORCE_64)))
|
||||
|
||||
$(call add_json_str, VendorSecurityPatch, $(VENDOR_SECURITY_PATCH))
|
||||
$(call add_json_str, VendorImageFileSystemType, $(BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE))
|
||||
|
||||
$(call add_json_list, BuildVersionTags, $(BUILD_VERSION_TAGS))
|
||||
|
||||
$(call add_json_bool, ProductNotDebuggableInUserdebug, $(PRODUCT_NOT_DEBUGGABLE_IN_USERDEBUG))
|
||||
|
||||
$(call add_json_bool, UsesProductImage, $(filter true,$(BOARD_USES_PRODUCTIMAGE)))
|
||||
|
||||
$(call add_json_bool, TargetBoots16K, $(filter true,$(TARGET_BOOTS_16K)))
|
||||
|
||||
$(call json_end)
|
||||
|
||||
$(shell mkdir -p $(dir $(SOONG_EXTRA_VARIABLES)))
|
||||
$(file >$(SOONG_EXTRA_VARIABLES).tmp,$(json_contents))
|
||||
|
||||
$(shell if ! cmp -s $(SOONG_EXTRA_VARIABLES).tmp $(SOONG_EXTRA_VARIABLES); then \
|
||||
mv $(SOONG_EXTRA_VARIABLES).tmp $(SOONG_EXTRA_VARIABLES); \
|
||||
else \
|
||||
rm $(SOONG_EXTRA_VARIABLES).tmp; \
|
||||
fi)
|
191
core/sysprop.mk
191
core/sysprop.mk
|
@ -29,38 +29,32 @@ POST_PROCESS_PROPS := $(HOST_OUT_EXECUTABLES)/post_process_props$(HOST_EXECUTABL
|
|||
# $(1): Partition name
|
||||
# $(2): Output file name
|
||||
define generate-common-build-props
|
||||
bash -c '\
|
||||
$(or $(PRODUCT_BUILD_PROP_OVERRIDES),:);\
|
||||
echo "####################################" >> $(2);\
|
||||
echo "# from generate-common-build-props" >> $(2);\
|
||||
echo "# These properties identify this partition image." >> $(2);\
|
||||
echo "####################################" >> $(2);\
|
||||
$(if $(filter system,$(1)),\
|
||||
echo "ro.product.$(1).brand=$(PRODUCT_SYSTEM_BRAND)" >> $(2);\
|
||||
echo "ro.product.$(1).device=$(PRODUCT_SYSTEM_DEVICE)" >> $(2);\
|
||||
echo "ro.product.$(1).manufacturer=$(PRODUCT_SYSTEM_MANUFACTURER)" >> $(2);\
|
||||
echo "ro.product.$(1).model=$(PRODUCT_SYSTEM_MODEL)" >> $(2);\
|
||||
echo "ro.product.$(1).name=$(PRODUCT_SYSTEM_NAME)" >> $(2);\
|
||||
,\
|
||||
echo "ro.product.$(1).brand=$(PRODUCT_BRAND)" >> $(2);\
|
||||
echo "ro.product.$(1).device=$(TARGET_DEVICE)" >> $(2);\
|
||||
echo "ro.product.$(1).manufacturer=$(PRODUCT_MANUFACTURER)" >> $(2);\
|
||||
echo "ro.product.$(1).model=$(PRODUCT_MODEL)" >> $(2);\
|
||||
echo "ro.product.$(1).name=$(TARGET_PRODUCT)" >> $(2);\
|
||||
if [ -n "$(strip $(PRODUCT_MODEL_FOR_ATTESTATION))" ]; then \
|
||||
echo "ro.product.model_for_attestation=$(PRODUCT_MODEL_FOR_ATTESTATION)" >> $(2);\
|
||||
fi; \
|
||||
if [ -n "$(strip $(PRODUCT_BRAND_FOR_ATTESTATION))" ]; then \
|
||||
echo "ro.product.brand_for_attestation=$(PRODUCT_BRAND_FOR_ATTESTATION)" >> $(2);\
|
||||
fi; \
|
||||
if [ -n "$(strip $(PRODUCT_NAME_FOR_ATTESTATION))" ]; then \
|
||||
echo "ro.product.name_for_attestation=$(PRODUCT_NAME_FOR_ATTESTATION)" >> $(2);\
|
||||
fi; \
|
||||
if [ -n "$(strip $(PRODUCT_DEVICE_FOR_ATTESTATION))" ]; then \
|
||||
echo "ro.product.device_for_attestation=$(PRODUCT_DEVICE_FOR_ATTESTATION)" >> $(2);\
|
||||
fi; \
|
||||
if [ -n "$(strip $(PRODUCT_MANUFACTURER_FOR_ATTESTATION))" ]; then \
|
||||
echo "ro.product.manufacturer_for_attestation=$(PRODUCT_MANUFACTURER_FOR_ATTESTATION)" >> $(2);\
|
||||
fi; \
|
||||
)\
|
||||
echo "ro.product.$(1).brand=$(PRODUCT_BRAND)" >> $(2);\
|
||||
echo "ro.product.$(1).device=$${DeviceName:-$(TARGET_DEVICE)}" >> $(2);\
|
||||
echo "ro.product.$(1).manufacturer=$(PRODUCT_MANUFACTURER)" >> $(2);\
|
||||
echo "ro.product.$(1).model=$${ProductModel:-$(PRODUCT_MODEL)}" >> $(2);\
|
||||
echo "ro.product.$(1).name=$${DeviceProduct:-$(TARGET_PRODUCT)}" >> $(2);\
|
||||
if [ -n "$(strip $(PRODUCT_MODEL_FOR_ATTESTATION))" ]; then \
|
||||
echo "ro.product.model_for_attestation=$(PRODUCT_MODEL_FOR_ATTESTATION)" >> $(2);\
|
||||
fi; \
|
||||
if [ -n "$(strip $(PRODUCT_BRAND_FOR_ATTESTATION))" ]; then \
|
||||
echo "ro.product.brand_for_attestation=$(PRODUCT_BRAND_FOR_ATTESTATION)" >> $(2);\
|
||||
fi; \
|
||||
if [ -n "$(strip $(PRODUCT_NAME_FOR_ATTESTATION))" ]; then \
|
||||
echo "ro.product.name_for_attestation=$(PRODUCT_NAME_FOR_ATTESTATION)" >> $(2);\
|
||||
fi; \
|
||||
if [ -n "$(strip $(PRODUCT_DEVICE_FOR_ATTESTATION))" ]; then \
|
||||
echo "ro.product.device_for_attestation=$(PRODUCT_DEVICE_FOR_ATTESTATION)" >> $(2);\
|
||||
fi; \
|
||||
if [ -n "$(strip $(PRODUCT_MANUFACTURER_FOR_ATTESTATION))" ]; then \
|
||||
echo "ro.product.manufacturer_for_attestation=$(PRODUCT_MANUFACTURER_FOR_ATTESTATION)" >> $(2);\
|
||||
fi; \
|
||||
$(if $(filter true,$(ZYGOTE_FORCE_64)),\
|
||||
$(if $(filter vendor,$(1)),\
|
||||
echo "ro.$(1).product.cpu.abilist=$(TARGET_CPU_ABI_LIST_64_BIT)" >> $(2);\
|
||||
|
@ -76,10 +70,7 @@ define generate-common-build-props
|
|||
)\
|
||||
echo "ro.$(1).build.date=`$(DATE_FROM_FILE)`" >> $(2);\
|
||||
echo "ro.$(1).build.date.utc=`$(DATE_FROM_FILE) +%s`" >> $(2);\
|
||||
# Allow optional assignments for ARC forward-declarations (b/249168657)
|
||||
# TODO: Remove any tag-related inconsistencies once the goals from
|
||||
# go/arc-android-sigprop-changes have been achieved.
|
||||
echo "ro.$(1).build.fingerprint?=$(BUILD_FINGERPRINT_FROM_FILE)" >> $(2);\
|
||||
echo "ro.$(1).build.fingerprint?=$${BuildFingerprint:-$(BUILD_FINGERPRINT_FROM_FILE)}" >> $(2);\
|
||||
echo "ro.$(1).build.id?=$(BUILD_ID)" >> $(2);\
|
||||
echo "ro.$(1).build.tags?=$(BUILD_VERSION_TAGS)" >> $(2);\
|
||||
echo "ro.$(1).build.type=$(TARGET_BUILD_VARIANT)" >> $(2);\
|
||||
|
@ -87,6 +78,7 @@ define generate-common-build-props
|
|||
echo "ro.$(1).build.version.release=$(PLATFORM_VERSION_LAST_STABLE)" >> $(2);\
|
||||
echo "ro.$(1).build.version.release_or_codename=$(PLATFORM_VERSION)" >> $(2);\
|
||||
echo "ro.$(1).build.version.sdk=$(PLATFORM_SDK_VERSION)" >> $(2);\
|
||||
';\
|
||||
|
||||
endef
|
||||
|
||||
|
@ -226,50 +218,11 @@ KNOWN_OEM_THUMBPRINT_PROPERTIES:=
|
|||
# -----------------------------------------------------------------
|
||||
# system/build.prop
|
||||
#
|
||||
# Note: parts of this file that can't be generated by the build-properties
|
||||
# macro are manually created as separate files and then fed into the macro
|
||||
|
||||
buildinfo_prop := $(call intermediates-dir-for,ETC,buildinfo.prop)/buildinfo.prop
|
||||
|
||||
ifdef TARGET_SYSTEM_PROP
|
||||
system_prop_file := $(TARGET_SYSTEM_PROP)
|
||||
else
|
||||
system_prop_file := $(wildcard $(TARGET_DEVICE_DIR)/system.prop)
|
||||
endif
|
||||
|
||||
_prop_files_ := \
|
||||
$(buildinfo_prop) \
|
||||
$(system_prop_file)
|
||||
|
||||
# Order matters here. When there are duplicates, the last one wins.
|
||||
# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
|
||||
_prop_vars_ := \
|
||||
ADDITIONAL_SYSTEM_PROPERTIES \
|
||||
PRODUCT_SYSTEM_PROPERTIES
|
||||
|
||||
# TODO(b/117892318): deprecate this
|
||||
_prop_vars_ += \
|
||||
PRODUCT_SYSTEM_DEFAULT_PROPERTIES
|
||||
|
||||
ifndef property_overrides_split_enabled
|
||||
_prop_vars_ += \
|
||||
ADDITIONAL_VENDOR_PROPERTIES \
|
||||
PRODUCT_VENDOR_PROPERTIES
|
||||
endif
|
||||
# system/build.prop is built by Soong. See system-build.prop module in
|
||||
# build/soong/Android.bp.
|
||||
|
||||
INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop
|
||||
|
||||
$(eval $(call build-properties,\
|
||||
system,\
|
||||
$(INSTALLED_BUILD_PROP_TARGET),\
|
||||
$(_prop_files_),\
|
||||
$(_prop_vars_),\
|
||||
$(PRODUCT_SYSTEM_PROPERTY_BLACKLIST),\
|
||||
$(empty),\
|
||||
$(empty)))
|
||||
|
||||
$(eval $(call declare-1p-target,$(INSTALLED_BUILD_PROP_TARGET)))
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# vendor/build.prop
|
||||
#
|
||||
|
@ -313,83 +266,18 @@ $(eval $(call declare-1p-target,$(INSTALLED_VENDOR_BUILD_PROP_TARGET)))
|
|||
# -----------------------------------------------------------------
|
||||
# product/etc/build.prop
|
||||
#
|
||||
|
||||
_prop_files_ := $(if $(TARGET_PRODUCT_PROP),\
|
||||
$(TARGET_PRODUCT_PROP),\
|
||||
$(wildcard $(TARGET_DEVICE_DIR)/product.prop))
|
||||
|
||||
# Order matters here. When there are duplicates, the last one wins.
|
||||
# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
|
||||
_prop_vars_ := \
|
||||
ADDITIONAL_PRODUCT_PROPERTIES \
|
||||
PRODUCT_PRODUCT_PROPERTIES
|
||||
# product/etc/build.prop is built by Soong. See product-build.prop module in
|
||||
# build/soong/Android.bp.
|
||||
|
||||
INSTALLED_PRODUCT_BUILD_PROP_TARGET := $(TARGET_OUT_PRODUCT)/etc/build.prop
|
||||
|
||||
ifdef PRODUCT_OEM_PROPERTIES
|
||||
import_oem_prop := $(call intermediates-dir-for,ETC,import_oem_prop)/oem.prop
|
||||
|
||||
$(import_oem_prop):
|
||||
$(hide) echo "####################################" >> $@; \
|
||||
echo "# PRODUCT_OEM_PROPERTIES" >> $@; \
|
||||
echo "####################################" >> $@;
|
||||
$(hide) $(foreach prop,$(PRODUCT_OEM_PROPERTIES), \
|
||||
echo "import /oem/oem.prop $(prop)" >> $@;)
|
||||
|
||||
_footers_ := $(import_oem_prop)
|
||||
else
|
||||
_footers_ :=
|
||||
endif
|
||||
|
||||
# Skip common /product properties generation if device released before R and
|
||||
# has no product partition. This is the first part of the check.
|
||||
ifeq ($(call math_lt,$(if $(PRODUCT_SHIPPING_API_LEVEL),$(PRODUCT_SHIPPING_API_LEVEL),30),30), true)
|
||||
_skip_common_properties := true
|
||||
endif
|
||||
|
||||
# The second part of the check - always generate common properties for the
|
||||
# devices with product partition regardless of shipping level.
|
||||
ifneq ($(BOARD_USES_PRODUCTIMAGE),)
|
||||
_skip_common_properties :=
|
||||
endif
|
||||
|
||||
$(eval $(call build-properties,\
|
||||
product,\
|
||||
$(INSTALLED_PRODUCT_BUILD_PROP_TARGET),\
|
||||
$(_prop_files_),\
|
||||
$(_prop_vars_),\
|
||||
$(empty),\
|
||||
$(_footers_),\
|
||||
$(_skip_common_properties)))
|
||||
|
||||
$(eval $(call declare-1p-target,$(INSTALLED_PRODUCT_BUILD_PROP_TARGET)))
|
||||
|
||||
_skip_common_properties :=
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# odm/etc/build.prop
|
||||
#
|
||||
_prop_files_ := $(if $(TARGET_ODM_PROP),\
|
||||
$(TARGET_ODM_PROP),\
|
||||
$(wildcard $(TARGET_DEVICE_DIR)/odm.prop))
|
||||
|
||||
# Order matters here. When there are duplicates, the last one wins.
|
||||
# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
|
||||
_prop_vars_ := \
|
||||
ADDITIONAL_ODM_PROPERTIES \
|
||||
PRODUCT_ODM_PROPERTIES
|
||||
# odm/etc/build.prop is built by Soong. See odm-build.prop module in
|
||||
# build/soong/Android.bp.
|
||||
|
||||
INSTALLED_ODM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM)/etc/build.prop
|
||||
$(eval $(call build-properties,\
|
||||
odm,\
|
||||
$(INSTALLED_ODM_BUILD_PROP_TARGET),\
|
||||
$(_prop_files_),\
|
||||
$(_prop_vars_),\
|
||||
$(empty),\
|
||||
$(empty),\
|
||||
$(empty)))
|
||||
|
||||
$(eval $(call declare-1p-target,$(INSTALLED_ODM_BUILD_PROP_TARGET)))
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# vendor_dlkm/etc/build.prop
|
||||
|
@ -442,25 +330,10 @@ $(eval $(call declare-1p-target,$(INSTALLED_SYSTEM_DLKM_BUILD_PROP_TARGET)))
|
|||
# -----------------------------------------------------------------
|
||||
# system_ext/etc/build.prop
|
||||
#
|
||||
_prop_files_ := $(if $(TARGET_SYSTEM_EXT_PROP),\
|
||||
$(TARGET_SYSTEM_EXT_PROP),\
|
||||
$(wildcard $(TARGET_DEVICE_DIR)/system_ext.prop))
|
||||
|
||||
# Order matters here. When there are duplicates, the last one wins.
|
||||
# TODO(b/117892318): don't allow duplicates so that the ordering doesn't matter
|
||||
_prop_vars_ := PRODUCT_SYSTEM_EXT_PROPERTIES
|
||||
# system_ext/etc/build.prop is built by Soong. See system-build.prop module in
|
||||
# build/soong/Android.bp.
|
||||
|
||||
INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET := $(TARGET_OUT_SYSTEM_EXT)/etc/build.prop
|
||||
$(eval $(call build-properties,\
|
||||
system_ext,\
|
||||
$(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET),\
|
||||
$(_prop_files_),\
|
||||
$(_prop_vars_),\
|
||||
$(empty),\
|
||||
$(empty),\
|
||||
$(empty)))
|
||||
|
||||
$(eval $(call declare-1p-target,$(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET)))
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
# ramdisk/boot/etc/build.prop
|
||||
|
|
|
@ -15,57 +15,9 @@ $(foreach name, $(_additional_prop_var_names),\
|
|||
)
|
||||
_additional_prop_var_names :=
|
||||
|
||||
#
|
||||
# -----------------------------------------------------------------
|
||||
# Add the product-defined properties to the build properties.
|
||||
ifneq ($(BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED), true)
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += $(PRODUCT_PROPERTY_OVERRIDES)
|
||||
else
|
||||
ifndef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += $(PRODUCT_PROPERTY_OVERRIDES)
|
||||
endif
|
||||
endif
|
||||
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += ro.treble.enabled=${PRODUCT_FULL_TREBLE}
|
||||
|
||||
# Set ro.llndk.api_level to show the maximum vendor API level that the LLNDK in
|
||||
# the system partition supports.
|
||||
ifdef RELEASE_BOARD_API_LEVEL
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += ro.llndk.api_level=$(RELEASE_BOARD_API_LEVEL)
|
||||
endif
|
||||
|
||||
# Sets ro.actionable_compatible_property.enabled to know on runtime whether the
|
||||
# allowed list of actionable compatible properties is enabled or not.
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += ro.actionable_compatible_property.enabled=true
|
||||
|
||||
# Add the system server compiler filter if they are specified for the product.
|
||||
ifneq (,$(PRODUCT_SYSTEM_SERVER_COMPILER_FILTER))
|
||||
ADDITIONAL_PRODUCT_PROPERTIES += dalvik.vm.systemservercompilerfilter=$(PRODUCT_SYSTEM_SERVER_COMPILER_FILTER)
|
||||
endif
|
||||
|
||||
# Add the 16K developer option if it is defined for the product.
|
||||
ifeq ($(PRODUCT_16K_DEVELOPER_OPTION),true)
|
||||
ADDITIONAL_PRODUCT_PROPERTIES += ro.product.build.16k_page.enabled=true
|
||||
else
|
||||
ADDITIONAL_PRODUCT_PROPERTIES += ro.product.build.16k_page.enabled=false
|
||||
endif
|
||||
|
||||
# Enable core platform API violation warnings on userdebug and eng builds.
|
||||
ifneq ($(TARGET_BUILD_VARIANT),user)
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += persist.debug.dalvik.vm.core_platform_api_policy=just-warn
|
||||
endif
|
||||
|
||||
# Define ro.sanitize.<name> properties for all global sanitizers.
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += $(foreach s,$(SANITIZE_TARGET),ro.sanitize.$(s)=true)
|
||||
|
||||
# Sets the default value of ro.postinstall.fstab.prefix to /system.
|
||||
# Device board config should override the value to /product when needed by:
|
||||
#
|
||||
# PRODUCT_PRODUCT_PROPERTIES += ro.postinstall.fstab.prefix=/product
|
||||
#
|
||||
# It then uses ${ro.postinstall.fstab.prefix}/etc/fstab.postinstall to
|
||||
# mount system_other partition.
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += ro.postinstall.fstab.prefix=/system
|
||||
$(KATI_obsolete_var ADDITIONAL_SYSTEM_PROPERTIES,Use build/soong/scripts/gen_build_prop.py instead)
|
||||
$(KATI_obsolete_var ADDITIONAL_ODM_PROPERTIES,Use build/soong/scripts/gen_build_prop.py instead)
|
||||
$(KATI_obsolete_var ADDITIONAL_PRODUCT_PROPERTIES,Use build/soong/scripts/gen_build_prop.py instead)
|
||||
|
||||
# Add cpu properties for bionic and ART.
|
||||
ADDITIONAL_VENDOR_PROPERTIES += ro.bionic.arch=$(TARGET_ARCH)
|
||||
|
@ -178,118 +130,16 @@ ADDITIONAL_VENDOR_PROPERTIES += \
|
|||
ro.build.ab_update=$(AB_OTA_UPDATER)
|
||||
endif
|
||||
|
||||
ADDITIONAL_PRODUCT_PROPERTIES += ro.build.characteristics=$(TARGET_AAPT_CHARACTERISTICS)
|
||||
|
||||
ifeq ($(AB_OTA_UPDATER),true)
|
||||
ADDITIONAL_PRODUCT_PROPERTIES += ro.product.ab_ota_partitions=$(subst $(space),$(comma),$(sort $(AB_OTA_PARTITIONS)))
|
||||
ADDITIONAL_VENDOR_PROPERTIES += ro.vendor.build.ab_ota_partitions=$(subst $(space),$(comma),$(sort $(AB_OTA_PARTITIONS)))
|
||||
endif
|
||||
|
||||
# Set this property for VTS to skip large page size tests on unsupported devices.
|
||||
ADDITIONAL_PRODUCT_PROPERTIES += \
|
||||
ro.product.cpu.pagesize.max=$(TARGET_MAX_PAGE_SIZE_SUPPORTED)
|
||||
|
||||
ifeq ($(PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO),true)
|
||||
ADDITIONAL_PRODUCT_PROPERTIES += ro.product.build.no_bionic_page_size_macro=true
|
||||
endif
|
||||
|
||||
user_variant := $(filter user userdebug,$(TARGET_BUILD_VARIANT))
|
||||
enable_target_debugging := true
|
||||
enable_dalvik_lock_contention_logging := true
|
||||
ifneq (,$(user_variant))
|
||||
# Target is secure in user builds.
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += ro.secure=1
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += security.perf_harden=1
|
||||
|
||||
ifeq ($(user_variant),user)
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += ro.adb.secure=1
|
||||
endif
|
||||
|
||||
ifneq ($(user_variant),userdebug)
|
||||
# Disable debugging in plain user builds.
|
||||
enable_target_debugging :=
|
||||
enable_dalvik_lock_contention_logging :=
|
||||
else
|
||||
# Disable debugging in userdebug builds if PRODUCT_NOT_DEBUGGABLE_IN_USERDEBUG
|
||||
# is set.
|
||||
ifneq (,$(strip $(PRODUCT_NOT_DEBUGGABLE_IN_USERDEBUG)))
|
||||
enable_target_debugging :=
|
||||
endif
|
||||
endif
|
||||
|
||||
# Disallow mock locations by default for user builds
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += ro.allow.mock.location=0
|
||||
|
||||
else # !user_variant
|
||||
# Turn on checkjni for non-user builds.
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += ro.kernel.android.checkjni=1
|
||||
# Set device insecure for non-user builds.
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += ro.secure=0
|
||||
# Allow mock locations by default for non user builds
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += ro.allow.mock.location=1
|
||||
endif # !user_variant
|
||||
|
||||
ifeq (true,$(strip $(enable_dalvik_lock_contention_logging)))
|
||||
# Enable Dalvik lock contention logging.
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += dalvik.vm.lockprof.threshold=500
|
||||
endif # !enable_dalvik_lock_contention_logging
|
||||
|
||||
ifeq (true,$(strip $(enable_target_debugging)))
|
||||
# Target is more debuggable and adbd is on by default
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += ro.debuggable=1
|
||||
else # !enable_target_debugging
|
||||
# Target is less debuggable and adbd is off by default
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += ro.debuggable=0
|
||||
endif # !enable_target_debugging
|
||||
|
||||
enable_target_debugging:=
|
||||
enable_dalvik_lock_contention_logging:=
|
||||
|
||||
ifneq ($(filter sdk sdk_addon,$(MAKECMDGOALS)),)
|
||||
_is_sdk_build := true
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_BUILD_VARIANT),eng)
|
||||
ifneq ($(filter ro.setupwizard.mode=ENABLED, $(call collapse-pairs, $(ADDITIONAL_SYSTEM_PROPERTIES))),)
|
||||
# Don't require the setup wizard on eng builds
|
||||
ADDITIONAL_SYSTEM_PROPERTIES := $(filter-out ro.setupwizard.mode=%,\
|
||||
$(call collapse-pairs, $(ADDITIONAL_SYSTEM_PROPERTIES))) \
|
||||
ro.setupwizard.mode=OPTIONAL
|
||||
endif
|
||||
ifndef _is_sdk_build
|
||||
# To speedup startup of non-preopted builds, don't verify or compile the boot image.
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += dalvik.vm.image-dex2oat-filter=extract
|
||||
endif
|
||||
# b/323566535
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += init.svc_debug.no_fatal.zygote=true
|
||||
endif
|
||||
|
||||
ifdef _is_sdk_build
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += xmpp.auto-presence=true
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += ro.config.nocheckin=yes
|
||||
endif
|
||||
|
||||
_is_sdk_build :=
|
||||
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += net.bt.name=Android
|
||||
|
||||
# This property is set by flashing debug boot image, so default to false.
|
||||
ADDITIONAL_SYSTEM_PROPERTIES += ro.force.debuggable=0
|
||||
|
||||
config_enable_uffd_gc := \
|
||||
$(firstword $(OVERRIDE_ENABLE_UFFD_GC) $(PRODUCT_ENABLE_UFFD_GC) default)
|
||||
|
||||
# This is a temporary system property that controls the ART module. The plan is
|
||||
# to remove it by Aug 2025, at which time Mainline updates of the ART module
|
||||
# will ignore it as well.
|
||||
# If the value is "default", it will be mangled by post_process_props.py.
|
||||
ADDITIONAL_PRODUCT_PROPERTIES += ro.dalvik.vm.enable_uffd_gc=$(config_enable_uffd_gc)
|
||||
|
||||
ADDITIONAL_SYSTEM_PROPERTIES := $(strip $(ADDITIONAL_SYSTEM_PROPERTIES))
|
||||
ADDITIONAL_PRODUCT_PROPERTIES := $(strip $(ADDITIONAL_PRODUCT_PROPERTIES))
|
||||
ADDITIONAL_VENDOR_PROPERTIES := $(strip $(ADDITIONAL_VENDOR_PROPERTIES))
|
||||
|
||||
.KATI_READONLY += \
|
||||
ADDITIONAL_SYSTEM_PROPERTIES \
|
||||
ADDITIONAL_PRODUCT_PROPERTIES \
|
||||
ADDITIONAL_VENDOR_PROPERTIES
|
||||
|
|
19
envsetup.sh
19
envsetup.sh
|
@ -53,8 +53,8 @@ function build_build_var_cache()
|
|||
{
|
||||
local T=$(gettop)
|
||||
# Grep out the variable names from the script.
|
||||
cached_vars=(`cat $T/build/envsetup.sh | tr '()' ' ' | awk '{for(i=1;i<=NF;i++) if($i~/_get_build_var_cached/) print $(i+1)}' | sort -u | tr '\n' ' '`)
|
||||
cached_abs_vars=(`cat $T/build/envsetup.sh | tr '()' ' ' | awk '{for(i=1;i<=NF;i++) if($i~/_get_abs_build_var_cached/) print $(i+1)}' | sort -u | tr '\n' ' '`)
|
||||
cached_vars=(`cat $T/build/envsetup.sh $T/vendor/tequila/build/envsetup.sh | tr '()' ' ' | awk '{for(i=1;i<=NF;i++) if($i~/_get_build_var_cached/) print $(i+1)}' | sort -u | tr '\n' ' '`)
|
||||
cached_abs_vars=(`cat $T/build/envsetup.sh $T/vendor/tequila/build/envsetup.sh | tr '()' ' ' | awk '{for(i=1;i<=NF;i++) if($i~/_get_abs_build_var_cached/) print $(i+1)}' | sort -u | tr '\n' ' '`)
|
||||
# Call the build system to dump the "<val>=<value>" pairs as a shell script.
|
||||
build_dicts_script=`\builtin cd $T; build/soong/soong_ui.bash --dumpvars-mode \
|
||||
--vars="${cached_vars[*]}" \
|
||||
|
@ -324,8 +324,6 @@ function set_stuff_for_environment()
|
|||
{
|
||||
set_lunch_paths
|
||||
set_sequence_number
|
||||
|
||||
export ANDROID_BUILD_TOP=$(gettop)
|
||||
}
|
||||
|
||||
function set_sequence_number()
|
||||
|
@ -524,12 +522,21 @@ function _lunch_meat()
|
|||
# Note this is the string "release", not the value of the variable.
|
||||
export TARGET_BUILD_TYPE=release
|
||||
|
||||
local no_kernel=$(_get_build_var_cached TARGET_NO_KERNEL)
|
||||
if [[ "$no_kernel" == "true" ]]; then
|
||||
unset INLINE_KERNEL_BUILDING
|
||||
else
|
||||
export INLINE_KERNEL_BUILDING=true
|
||||
fi
|
||||
|
||||
[[ -n "${ANDROID_QUIET_BUILD:-}" ]] || echo
|
||||
|
||||
fixup_common_out_dir
|
||||
|
||||
set_stuff_for_environment
|
||||
[[ -n "${ANDROID_QUIET_BUILD:-}" ]] || printconfig
|
||||
|
||||
if [[ -z "${ANDROID_QUIET_BUILD}" ]]; then
|
||||
if [[ -z "${ANDROID_QUIET_BUILD}" && -z "${TEQUILA_BUILD}" ]]; then
|
||||
local spam_for_lunch=$(gettop)/build/make/tools/envsetup/spam_for_lunch
|
||||
if [[ -x $spam_for_lunch ]]; then
|
||||
$spam_for_lunch
|
||||
|
@ -1178,4 +1185,6 @@ set_global_paths
|
|||
source_vendorsetup
|
||||
addcompletions
|
||||
|
||||
export ANDROID_BUILD_TOP=$(gettop)
|
||||
|
||||
. $ANDROID_BUILD_TOP/vendor/tequila/build/envsetup.sh
|
||||
|
|
|
@ -114,11 +114,11 @@ function _wrap_build()
|
|||
echo -n "${color_failed}#### failed to build some targets "
|
||||
fi
|
||||
if [ $hours -gt 0 ] ; then
|
||||
printf "(%02g:%02g:%02g (hh:mm:ss))" $hours $mins $secs
|
||||
printf "(%02d:%02d:%02d (hh:mm:ss))" $hours $mins $secs
|
||||
elif [ $mins -gt 0 ] ; then
|
||||
printf "(%02g:%02g (mm:ss))" $mins $secs
|
||||
printf "(%02d:%02d (mm:ss))" $mins $secs
|
||||
elif [ $secs -gt 0 ] ; then
|
||||
printf "(%s seconds)" $secs
|
||||
printf "(%d seconds)" $secs
|
||||
fi
|
||||
echo " ####${color_reset}"
|
||||
echo
|
||||
|
|
|
@ -9,8 +9,6 @@ include build/make/target/product/build_variables.mk
|
|||
TARGET_NO_BOOTLOADER := true
|
||||
TARGET_NO_RECOVERY := true
|
||||
|
||||
BOARD_EXT4_SHARE_DUP_BLOCKS := true
|
||||
|
||||
TARGET_USERIMAGES_USE_EXT4 := true
|
||||
|
||||
# Mainline devices must have /system_ext, /vendor and /product partitions.
|
||||
|
|
|
@ -19,7 +19,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_product.mk)
|
|||
$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_product.mk)
|
||||
|
||||
# Default AOSP sounds
|
||||
ifeq ($(TEQUILA_BUILD),)
|
||||
$(call inherit-product-if-exists, frameworks/base/data/sounds/AllAudio.mk)
|
||||
endif
|
||||
|
||||
# Additional settings used in all AOSP builds
|
||||
PRODUCT_PRODUCT_PROPERTIES += \
|
||||
|
@ -37,5 +39,7 @@ PRODUCT_PACKAGES += \
|
|||
|
||||
# Telephony:
|
||||
# Provide a APN configuration to GSI product
|
||||
ifeq ($(TEQUILA_BUILD),)
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/sample/etc/apns-full-conf.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/apns-conf.xml
|
||||
endif
|
||||
|
|
|
@ -25,3 +25,4 @@ PRODUCT_PACKAGES += \
|
|||
product_compatibility_matrix.xml \
|
||||
product_manifest.xml \
|
||||
selinux_policy_product \
|
||||
product-build.prop \
|
||||
|
|
|
@ -279,6 +279,7 @@ PRODUCT_PACKAGES += \
|
|||
storaged \
|
||||
surfaceflinger \
|
||||
svc \
|
||||
system-build.prop \
|
||||
task_profiles.json \
|
||||
tc \
|
||||
telecom \
|
||||
|
@ -471,7 +472,6 @@ PRODUCT_PACKAGES_DEBUG := \
|
|||
ss \
|
||||
start_with_lockagent \
|
||||
strace \
|
||||
su \
|
||||
sanitizer-status \
|
||||
tracepath \
|
||||
tracepath6 \
|
||||
|
@ -480,6 +480,11 @@ PRODUCT_PACKAGES_DEBUG := \
|
|||
unwind_reg_info \
|
||||
unwind_symbols \
|
||||
|
||||
ifeq ($(TEQUILA_BUILD),)
|
||||
PRODUCT_PACKAGES_DEBUG += \
|
||||
su
|
||||
endif
|
||||
|
||||
# The set of packages whose code can be loaded by the system server.
|
||||
PRODUCT_SYSTEM_SERVER_APPS += \
|
||||
SettingsProvider \
|
||||
|
|
|
@ -24,6 +24,7 @@ PRODUCT_PACKAGES += \
|
|||
SatelliteClient \
|
||||
selinux_policy_system_ext \
|
||||
system_ext_manifest.xml \
|
||||
system_ext-build.prop \
|
||||
|
||||
# Base modules when shipping api level is less than or equal to 34
|
||||
PRODUCT_PACKAGES_SHIPPING_API_LEVEL_34 += \
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
# Base modules and settings for recovery.
|
||||
PRODUCT_PACKAGES += \
|
||||
adbd.recovery \
|
||||
android.hardware.health@2.0-impl-default.recovery \
|
||||
build_flag_vendor \
|
||||
cgroups.recovery.json \
|
||||
charger.recovery \
|
||||
|
@ -73,6 +72,7 @@ PRODUCT_PACKAGES += \
|
|||
passwd_vendor \
|
||||
selinux_policy_nonsystem \
|
||||
shell_and_utilities_vendor \
|
||||
odm-build.prop \
|
||||
|
||||
# Base modules when shipping api level is less than or equal to 34
|
||||
PRODUCT_PACKAGES_SHIPPING_API_LEVEL_34 += \
|
||||
|
|
|
@ -183,5 +183,3 @@ PRODUCT_SYSTEM_PROPERTIES += \
|
|||
dalvik.vm.image-dex2oat-Xmx=64m \
|
||||
dalvik.vm.dex2oat-Xms=64m \
|
||||
dalvik.vm.dex2oat-Xmx=512m \
|
||||
|
||||
PRODUCT_ENABLE_UFFD_GC := default
|
||||
|
|
|
@ -45,7 +45,9 @@ PRODUCT_VENDOR_PROPERTIES := \
|
|||
PRODUCT_LOCALES := en_US
|
||||
|
||||
# Get some sounds
|
||||
ifeq ($(TEQUILA_BUILD),)
|
||||
$(call inherit-product-if-exists, frameworks/base/data/sounds/AllAudio.mk)
|
||||
endif
|
||||
|
||||
# Get a list of languages.
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)
|
||||
|
|
|
@ -24,8 +24,12 @@ PRODUCT_VENDOR_PROPERTIES := \
|
|||
ro.com.android.dataroaming?=true
|
||||
|
||||
PRODUCT_COPY_FILES := \
|
||||
device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml \
|
||||
frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml
|
||||
|
||||
ifeq ($(TEQUILA_BUILD),)
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml
|
||||
endif
|
||||
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
|
||||
$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony.mk)
|
||||
|
|
|
@ -28,12 +28,16 @@ PRODUCT_PACKAGES += \
|
|||
Contacts \
|
||||
DeskClock \
|
||||
Gallery2 \
|
||||
LatinIME \
|
||||
Music \
|
||||
preinstalled-packages-platform-handheld-product.xml \
|
||||
QuickSearchBox \
|
||||
SettingsIntelligence \
|
||||
frameworks-base-overlays
|
||||
|
||||
ifeq ($(TEQUILA_BUILD),)
|
||||
PRODUCT_PACKAGES += \
|
||||
LatinIME
|
||||
endif
|
||||
|
||||
PRODUCT_PACKAGES_DEBUG += \
|
||||
frameworks-base-overlays-debug
|
||||
|
|
|
@ -45,7 +45,6 @@ PRODUCT_PACKAGES += \
|
|||
CertInstaller \
|
||||
CredentialManager \
|
||||
DeviceAsWebcam \
|
||||
DeviceDiagnostics \
|
||||
DocumentsUI \
|
||||
DownloadProviderUi \
|
||||
EasterEgg \
|
||||
|
@ -70,7 +69,6 @@ PRODUCT_PACKAGES += \
|
|||
Telecom \
|
||||
TelephonyProvider \
|
||||
TeleService \
|
||||
Traceur \
|
||||
UserDictionaryProvider \
|
||||
VpnDialogs \
|
||||
vr \
|
||||
|
@ -96,3 +94,7 @@ PRODUCT_VENDOR_PROPERTIES += \
|
|||
ro.carrier?=unknown \
|
||||
ro.config.notification_sound?=OnTheHunt.ogg \
|
||||
ro.config.alarm_alert?=Alarm_Classic.ogg
|
||||
|
||||
# Traceur for debug only
|
||||
PRODUCT_PACKAGES_ENG += \
|
||||
Traceur
|
||||
|
|
|
@ -30,9 +30,11 @@ fn read_partition_paths() -> Vec<PathBuf> {
|
|||
.collect()
|
||||
}
|
||||
|
||||
/// Determine all paths that contain an aconfig protobuf file.
|
||||
/// Determines all paths that contain an aconfig protobuf file,
|
||||
/// filtering out nonexistent partition protobuf files.
|
||||
pub fn parsed_flags_proto_paths() -> Result<Vec<PathBuf>> {
|
||||
let mut result: Vec<PathBuf> = read_partition_paths();
|
||||
let mut result: Vec<PathBuf> =
|
||||
read_partition_paths().into_iter().filter(|s| s.exists()).collect();
|
||||
|
||||
for dir in fs::read_dir("/apex")? {
|
||||
let dir = dir?;
|
||||
|
|
|
@ -787,9 +787,16 @@ def AddSuperEmpty(output_zip):
|
|||
img = OutputFile(output_zip, OPTIONS.input_tmp, "IMAGES", "super_empty.img")
|
||||
if os.path.exists(img.name):
|
||||
logger.info("super_empty.img already exists; no need to rebuild...")
|
||||
return
|
||||
build_super_image.BuildSuperImage(OPTIONS.info_dict, img.name)
|
||||
img.Write()
|
||||
else:
|
||||
build_super_image.BuildSuperImage(OPTIONS.info_dict, img.name)
|
||||
img.Write()
|
||||
|
||||
unsparse_img = OutputFile(output_zip, OPTIONS.input_tmp, "IMAGES", "unsparse_super_empty.img")
|
||||
if os.path.exists(unsparse_img.name):
|
||||
logger.info("unsparse_super_empty.img already exists; no need to rebuild...")
|
||||
else:
|
||||
build_super_image.BuildSuperImage(OPTIONS.info_dict, unsparse_img.name, force_non_sparse=True)
|
||||
unsparse_img.Write()
|
||||
|
||||
|
||||
def AddSuperSplit(output_zip):
|
||||
|
|
|
@ -312,7 +312,7 @@ def BuildImageMkfs(in_dir, prop_dict, out_file, target_out, fs_config):
|
|||
base_fs_file = ConvertBlockMapToBaseFs(prop_dict["base_fs_file"])
|
||||
build_command.extend(["-d", base_fs_file])
|
||||
build_command.extend(["-L", prop_dict["mount_point"]])
|
||||
if "extfs_inode_count" in prop_dict:
|
||||
if "extfs_inode_count" in prop_dict and int(prop_dict["extfs_inode_count"]) >= 0:
|
||||
build_command.extend(["-i", prop_dict["extfs_inode_count"]])
|
||||
if "extfs_rsv_pct" in prop_dict:
|
||||
build_command.extend(["-M", prop_dict["extfs_rsv_pct"]])
|
||||
|
@ -606,19 +606,20 @@ def BuildImage(in_dir, prop_dict, out_file, target_out=None):
|
|||
size = common.RoundUpTo4K(size)
|
||||
else:
|
||||
size = ((size + block_size - 1) // block_size) * block_size
|
||||
extfs_inode_count = prop_dict["extfs_inode_count"]
|
||||
inodes = int(fs_dict.get("Inode count", extfs_inode_count))
|
||||
inodes -= int(fs_dict.get("Free inodes", "0"))
|
||||
# add .2% margin or 1 inode, whichever is greater
|
||||
spare_inodes = inodes * 2 // 1000
|
||||
min_spare_inodes = 1
|
||||
if spare_inodes < min_spare_inodes:
|
||||
spare_inodes = min_spare_inodes
|
||||
inodes += spare_inodes
|
||||
prop_dict["extfs_inode_count"] = str(inodes)
|
||||
if int(prop_dict["extfs_inode_count"]) >= 0:
|
||||
extfs_inode_count = prop_dict["extfs_inode_count"]
|
||||
inodes = int(fs_dict.get("Inode count", extfs_inode_count))
|
||||
inodes -= int(fs_dict.get("Free inodes", "0"))
|
||||
# add .2% margin or 1 inode, whichever is greater
|
||||
spare_inodes = inodes * 2 // 1000
|
||||
min_spare_inodes = 1
|
||||
if spare_inodes < min_spare_inodes:
|
||||
spare_inodes = min_spare_inodes
|
||||
inodes += spare_inodes
|
||||
prop_dict["extfs_inode_count"] = str(inodes)
|
||||
logger.info(
|
||||
"Allocating %d Inodes for %s.", inodes, out_file)
|
||||
prop_dict["partition_size"] = str(size)
|
||||
logger.info(
|
||||
"Allocating %d Inodes for %s.", inodes, out_file)
|
||||
elif fs_type.startswith("f2fs") and prop_dict.get("f2fs_compress") == "true":
|
||||
prop_dict["partition_size"] = str(size)
|
||||
prop_dict["image_size"] = str(size)
|
||||
|
|
|
@ -62,14 +62,14 @@ def GetArgumentsForImage(partition, group, image=None):
|
|||
image_size = sparse_img.GetImagePartitionSize(image) if image else 0
|
||||
|
||||
cmd = ["--partition",
|
||||
"{}:readonly:{}:{}".format(partition, image_size, group)]
|
||||
"{}:none:{}:{}".format(partition, image_size, group)]
|
||||
if image:
|
||||
cmd += ["--image", "{}={}".format(partition, image)]
|
||||
|
||||
return cmd
|
||||
|
||||
|
||||
def BuildSuperImageFromDict(info_dict, output):
|
||||
def BuildSuperImageFromDict(info_dict, output, force_non_sparse=False):
|
||||
|
||||
cmd = [info_dict["lpmake"],
|
||||
"--metadata-size", "65536",
|
||||
|
@ -133,7 +133,7 @@ def BuildSuperImageFromDict(info_dict, output):
|
|||
|
||||
cmd += GetArgumentsForImage(partition + "_b", group + "_b", other_image)
|
||||
|
||||
if info_dict.get("build_non_sparse_super_partition") != "true":
|
||||
if info_dict.get("build_non_sparse_super_partition") != "true" and not force_non_sparse:
|
||||
cmd.append("--sparse")
|
||||
|
||||
cmd += ["--output", output]
|
||||
|
@ -178,11 +178,11 @@ def BuildSuperImageFromTargetFiles(inp, out):
|
|||
return BuildSuperImageFromExtractedTargetFiles(input_tmp, out)
|
||||
|
||||
|
||||
def BuildSuperImage(inp, out):
|
||||
def BuildSuperImage(inp, out, force_non_sparse=False):
|
||||
|
||||
if isinstance(inp, dict):
|
||||
logger.info("Building super image from info dict...")
|
||||
return BuildSuperImageFromDict(inp, out)
|
||||
return BuildSuperImageFromDict(inp, out, force_non_sparse=False)
|
||||
|
||||
if isinstance(inp, str):
|
||||
if os.path.isdir(inp):
|
||||
|
|
|
@ -445,7 +445,7 @@ class BuildInfo(object):
|
|||
"system_other"] = self._partition_fingerprints["system"]
|
||||
|
||||
# These two should be computed only after setting self._oem_props.
|
||||
self._device = self.GetOemProperty("ro.product.device")
|
||||
self._device = info_dict.get("ota_override_device", self.GetOemProperty("ro.product.device"))
|
||||
self._fingerprint = self.CalculateFingerprint()
|
||||
check_fingerprint(self._fingerprint)
|
||||
|
||||
|
@ -675,7 +675,7 @@ class BuildInfo(object):
|
|||
return self.GetBuildProp(key)
|
||||
|
||||
def GetPartitionFingerprint(self, partition):
|
||||
return self._partition_fingerprints.get(partition, None)
|
||||
return self._partition_fingerprints.get(partition, self.CalculateFingerprint())
|
||||
|
||||
def CalculatePartitionFingerprint(self, partition):
|
||||
try:
|
||||
|
@ -832,11 +832,14 @@ def ExtractFromInputFile(input_file, fn):
|
|||
class RamdiskFormat(object):
|
||||
LZ4 = 1
|
||||
GZ = 2
|
||||
XZ = 3
|
||||
|
||||
|
||||
def GetRamdiskFormat(info_dict):
|
||||
if info_dict.get('lz4_ramdisks') == 'true':
|
||||
ramdisk_format = RamdiskFormat.LZ4
|
||||
elif info_dict.get('xz_ramdisks') == 'true':
|
||||
ramdisk_format = RamdiskFormat.XZ
|
||||
else:
|
||||
ramdisk_format = RamdiskFormat.GZ
|
||||
return ramdisk_format
|
||||
|
@ -942,7 +945,11 @@ def LoadInfoDict(input_file, repacking=False):
|
|||
makeint(b.replace(".img", "_size"))
|
||||
|
||||
# Load recovery fstab if applicable.
|
||||
d["fstab"] = _FindAndLoadRecoveryFstab(d, input_file, read_helper)
|
||||
if isinstance(input_file, str) and zipfile.is_zipfile(input_file):
|
||||
with zipfile.ZipFile(input_file, 'r', allowZip64=True) as input_zip:
|
||||
d["fstab"] = _FindAndLoadRecoveryFstab(d, input_zip, read_helper)
|
||||
else:
|
||||
d["fstab"] = _FindAndLoadRecoveryFstab(d, input_file, read_helper)
|
||||
ramdisk_format = GetRamdiskFormat(d)
|
||||
|
||||
# Tries to load the build props for all partitions with care_map, including
|
||||
|
@ -1221,9 +1228,10 @@ def LoadRecoveryFSTab(read_helper, fstab_version, recovery_fstab_path):
|
|||
context = i
|
||||
|
||||
mount_point = pieces[1]
|
||||
d[mount_point] = Partition(mount_point=mount_point, fs_type=pieces[2],
|
||||
device=pieces[0], length=length, context=context,
|
||||
slotselect=slotselect)
|
||||
if not d.get(mount_point):
|
||||
d[mount_point] = Partition(mount_point=mount_point, fs_type=pieces[2],
|
||||
device=pieces[0], length=length, context=context,
|
||||
slotselect=slotselect)
|
||||
|
||||
return d
|
||||
|
||||
|
@ -1673,10 +1681,13 @@ def _MakeRamdisk(sourcedir, fs_config_file=None,
|
|||
if ramdisk_format == RamdiskFormat.LZ4:
|
||||
p2 = Run(["lz4", "-l", "-12", "--favor-decSpeed"], stdin=p1.stdout,
|
||||
stdout=ramdisk_img.file.fileno())
|
||||
elif ramdisk_format == RamdiskFormat.XZ:
|
||||
p2 = Run(["xz", "-f", "-c", "--check=crc32", "--lzma2=dict=32MiB"], stdin=p1.stdout,
|
||||
stdout=ramdisk_img.file.fileno())
|
||||
elif ramdisk_format == RamdiskFormat.GZ:
|
||||
p2 = Run(["gzip"], stdin=p1.stdout, stdout=ramdisk_img.file.fileno())
|
||||
else:
|
||||
raise ValueError("Only support lz4 or gzip ramdisk format.")
|
||||
raise ValueError("Only support lz4, xz or gzip ramdisk format.")
|
||||
|
||||
p2.wait()
|
||||
p1.wait()
|
||||
|
@ -1764,6 +1775,11 @@ def _BuildBootableImage(image_name, sourcedir, fs_config_file,
|
|||
cmd.append("--pagesize")
|
||||
cmd.append(open(fn).read().rstrip("\n"))
|
||||
|
||||
fn = os.path.join(sourcedir, "dt")
|
||||
if os.access(fn, os.F_OK):
|
||||
cmd.append("--dt")
|
||||
cmd.append(fn)
|
||||
|
||||
if partition_name == "recovery":
|
||||
args = info_dict.get("recovery_mkbootimg_args")
|
||||
if not args:
|
||||
|
@ -2861,6 +2877,7 @@ class PasswordManager(object):
|
|||
def __init__(self):
|
||||
self.editor = os.getenv("EDITOR")
|
||||
self.pwfile = os.getenv("ANDROID_PW_FILE")
|
||||
self.secure_storage_cmd = os.getenv("ANDROID_SECURE_STORAGE_CMD", None)
|
||||
|
||||
def GetPasswords(self, items):
|
||||
"""Get passwords corresponding to each string in 'items',
|
||||
|
@ -2880,7 +2897,19 @@ class PasswordManager(object):
|
|||
missing = []
|
||||
for i in items:
|
||||
if i not in current or not current[i]:
|
||||
missing.append(i)
|
||||
# Attempt to load using ANDROID_SECURE_STORAGE_CMD
|
||||
if self.secure_storage_cmd:
|
||||
try:
|
||||
os.environ["TMP__KEY_FILE_NAME"] = str(i)
|
||||
ps = subprocess.Popen(self.secure_storage_cmd, shell=True, stdout=subprocess.PIPE)
|
||||
output = ps.communicate()[0]
|
||||
if ps.returncode == 0:
|
||||
current[i] = output.decode('utf-8')
|
||||
except Exception as e:
|
||||
print(e)
|
||||
pass
|
||||
if i not in current or not current[i]:
|
||||
missing.append(i)
|
||||
# Are all the passwords already in the file?
|
||||
if not missing:
|
||||
return current
|
||||
|
@ -3171,6 +3200,11 @@ class DeviceSpecificParams(object):
|
|||
used to install the image for the device's baseband processor."""
|
||||
return self._DoCall("FullOTA_InstallEnd")
|
||||
|
||||
def FullOTA_PostValidate(self):
|
||||
"""Called after installing and validating /system; typically this is
|
||||
used to resize the system partition after a block based installation."""
|
||||
return self._DoCall("FullOTA_PostValidate")
|
||||
|
||||
def IncrementalOTA_Assertions(self):
|
||||
"""Called after emitting the block of assertions at the top of an
|
||||
incremental OTA package. Implementations can add whatever
|
||||
|
@ -3785,40 +3819,19 @@ def MakeRecoveryPatch(input_dir, output_sink, recovery_img, boot_img,
|
|||
|
||||
full_recovery_image = info_dict.get("full_recovery_image") == "true"
|
||||
board_uses_vendorimage = info_dict.get("board_uses_vendorimage") == "true"
|
||||
board_builds_vendorimage = info_dict.get("board_builds_vendorimage") == "true"
|
||||
|
||||
if board_uses_vendorimage:
|
||||
# In this case, the output sink is rooted at VENDOR
|
||||
if board_builds_vendorimage or not board_uses_vendorimage:
|
||||
recovery_img_path = "etc/recovery.img"
|
||||
recovery_resource_dat_path = "VENDOR/etc/recovery-resource.dat"
|
||||
sh_dir = "bin"
|
||||
else:
|
||||
# In this case the output sink is rooted at SYSTEM
|
||||
recovery_img_path = "vendor/etc/recovery.img"
|
||||
recovery_resource_dat_path = "SYSTEM/vendor/etc/recovery-resource.dat"
|
||||
sh_dir = "vendor/bin"
|
||||
logger.warning('Recovery patch generation is disable when prebuilt vendor image is used.')
|
||||
return None
|
||||
|
||||
if full_recovery_image:
|
||||
output_sink(recovery_img_path, recovery_img.data)
|
||||
|
||||
else:
|
||||
include_recovery_dtbo = info_dict.get("include_recovery_dtbo") == "true"
|
||||
include_recovery_acpio = info_dict.get("include_recovery_acpio") == "true"
|
||||
path = os.path.join(input_dir, recovery_resource_dat_path)
|
||||
# Use bsdiff to handle mismatching entries (Bug: 72731506)
|
||||
if include_recovery_dtbo or include_recovery_acpio:
|
||||
diff_program = ["bsdiff"]
|
||||
bonus_args = ""
|
||||
assert not os.path.exists(path)
|
||||
else:
|
||||
diff_program = ["imgdiff"]
|
||||
if os.path.exists(path):
|
||||
diff_program.append("-b")
|
||||
diff_program.append(path)
|
||||
bonus_args = "--bonus /vendor/etc/recovery-resource.dat"
|
||||
else:
|
||||
bonus_args = ""
|
||||
|
||||
d = Difference(recovery_img, boot_img, diff_program=diff_program)
|
||||
d = Difference(recovery_img, boot_img)
|
||||
_, _, patch = d.ComputePatch()
|
||||
output_sink("recovery-from-boot.p", patch)
|
||||
|
||||
|
@ -3856,7 +3869,7 @@ fi
|
|||
else:
|
||||
sh = """#!/vendor/bin/sh
|
||||
if ! applypatch --check %(recovery_type)s:%(recovery_device)s:%(recovery_size)d:%(recovery_sha1)s; then
|
||||
applypatch %(bonus_args)s \\
|
||||
applypatch \\
|
||||
--patch /vendor/recovery-from-boot.p \\
|
||||
--source %(boot_type)s:%(boot_device)s:%(boot_size)d:%(boot_sha1)s \\
|
||||
--target %(recovery_type)s:%(recovery_device)s:%(recovery_size)d:%(recovery_sha1)s && \\
|
||||
|
@ -3872,16 +3885,11 @@ fi
|
|||
'boot_type': boot_type,
|
||||
'boot_device': boot_device + '$(getprop ro.boot.slot_suffix)',
|
||||
'recovery_type': recovery_type,
|
||||
'recovery_device': recovery_device + '$(getprop ro.boot.slot_suffix)',
|
||||
'bonus_args': bonus_args}
|
||||
'recovery_device': recovery_device + '$(getprop ro.boot.slot_suffix)'}
|
||||
|
||||
# The install script location moved from /system/etc to /system/bin in the L
|
||||
# release. In the R release it is in VENDOR/bin or SYSTEM/vendor/bin.
|
||||
sh_location = os.path.join(sh_dir, "install-recovery.sh")
|
||||
|
||||
logger.info("putting script in %s", sh_location)
|
||||
|
||||
output_sink(sh_location, sh.encode())
|
||||
output_sink("bin/install-recovery.sh", sh.encode())
|
||||
|
||||
|
||||
class DynamicPartitionUpdate(object):
|
||||
|
@ -3920,10 +3928,14 @@ class DynamicGroupUpdate(object):
|
|||
|
||||
class DynamicPartitionsDifference(object):
|
||||
def __init__(self, info_dict, block_diffs, progress_dict=None,
|
||||
source_info_dict=None):
|
||||
source_info_dict=None, build_without_vendor=False):
|
||||
if progress_dict is None:
|
||||
progress_dict = {}
|
||||
|
||||
self._have_super_empty = \
|
||||
info_dict.get("build_super_empty_partition") == "true"
|
||||
|
||||
self._build_without_vendor = build_without_vendor
|
||||
self._remove_all_before_apply = False
|
||||
if source_info_dict is None:
|
||||
self._remove_all_before_apply = True
|
||||
|
@ -4020,8 +4032,13 @@ class DynamicPartitionsDifference(object):
|
|||
ZipWrite(output_zip, op_list_path, "dynamic_partitions_op_list")
|
||||
|
||||
script.Comment('Update dynamic partition metadata')
|
||||
script.AppendExtra('assert(update_dynamic_partitions('
|
||||
'package_extract_file("dynamic_partitions_op_list")));')
|
||||
if self._have_super_empty:
|
||||
script.AppendExtra('assert(update_dynamic_partitions('
|
||||
'package_extract_file("dynamic_partitions_op_list"), '
|
||||
'package_extract_file("unsparse_super_empty.img")));')
|
||||
else:
|
||||
script.AppendExtra('assert(update_dynamic_partitions('
|
||||
'package_extract_file("dynamic_partitions_op_list")));')
|
||||
|
||||
if write_verify_script:
|
||||
for p, u in self._partition_updates.items():
|
||||
|
@ -4048,6 +4065,17 @@ class DynamicPartitionsDifference(object):
|
|||
def comment(line):
|
||||
self._op_list.append("# %s" % line)
|
||||
|
||||
if self._build_without_vendor:
|
||||
comment('System-only build, keep original vendor partition')
|
||||
# When building without vendor, we do not want to override
|
||||
# any partition already existing. In this case, we can only
|
||||
# resize, but not remove / create / re-create any other
|
||||
# partition.
|
||||
for p, u in self._partition_updates.items():
|
||||
comment('Resize partition %s to %s' % (p, u.tgt_size))
|
||||
append('resize %s %s' % (p, u.tgt_size))
|
||||
return
|
||||
|
||||
if self._remove_all_before_apply:
|
||||
comment('Remove all existing dynamic partitions and groups before '
|
||||
'applying full OTA')
|
||||
|
@ -4130,8 +4158,14 @@ def GetBootImageBuildProp(boot_img, ramdisk_format=RamdiskFormat.LZ4):
|
|||
p2 = Run(['gzip', '-d'], stdin=input_stream.fileno(),
|
||||
stdout=output_stream.fileno())
|
||||
p2.wait()
|
||||
elif ramdisk_format == RamdiskFormat.XZ:
|
||||
with open(ramdisk, 'rb') as input_stream:
|
||||
with open(uncompressed_ramdisk, 'wb') as output_stream:
|
||||
p2 = Run(['xz', '-d'], stdin=input_stream.fileno(),
|
||||
stdout=output_stream.fileno())
|
||||
p2.wait()
|
||||
else:
|
||||
logger.error('Only support lz4 or gzip ramdisk format.')
|
||||
logger.error('Only support lz4, xz or gzip ramdisk format.')
|
||||
return None
|
||||
|
||||
abs_uncompressed_ramdisk = os.path.abspath(uncompressed_ramdisk)
|
||||
|
|
|
@ -137,20 +137,39 @@ class EdifyGenerator(object):
|
|||
|
||||
def AssertDevice(self, device):
|
||||
"""Assert that the device identifier is the given string."""
|
||||
cmd = ('getprop("ro.product.device") == "%s" || '
|
||||
'abort("E%d: This package is for \\"%s\\" devices; '
|
||||
'this is a \\"" + getprop("ro.product.device") + "\\".");') % (
|
||||
device, common.ErrorCode.DEVICE_MISMATCH, device)
|
||||
self.script.append(cmd)
|
||||
cmd = ('assert(' +
|
||||
' || \0'.join(['getprop("ro.product.device") == "%s" || getprop("ro.build.product") == "%s"'
|
||||
% (i, i) for i in device.split(",")]) +
|
||||
' || abort("E%d: This package is for device: %s; ' +
|
||||
'this device is " + getprop("ro.product.device") + ".");' +
|
||||
');') % (common.ErrorCode.DEVICE_MISMATCH, device)
|
||||
self.script.append(self.WordWrap(cmd))
|
||||
|
||||
def AssertSomeBootloader(self, *bootloaders):
|
||||
"""Asert that the bootloader version is one of *bootloaders."""
|
||||
"""Assert that the bootloader version is one of *bootloaders."""
|
||||
cmd = ("assert(" +
|
||||
" ||\0".join(['getprop("ro.bootloader") == "%s"' % (b,)
|
||||
for b in bootloaders]) +
|
||||
' || abort("This package supports bootloader(s): ' +
|
||||
", ".join(["%s" % (b,) for b in bootloaders]) +
|
||||
'; this device has bootloader " + getprop("ro.bootloader") + ".");' +
|
||||
");")
|
||||
self.script.append(self.WordWrap(cmd))
|
||||
|
||||
def RunBackup(self, command, dynamic=False):
|
||||
systemEntry = self.fstab["/system"]
|
||||
if dynamic:
|
||||
for p in ["vendor", "product", "system_ext"]:
|
||||
fstabEntry = self.fstab.get("/"+p, None)
|
||||
if fstabEntry:
|
||||
self.script.append('map_partition("%s");' % (fstabEntry.device,))
|
||||
|
||||
self.script.append(('run_program("/tmp/install/bin/backuptool.sh", "%s", map_partition("%s"), "%s");' % (
|
||||
command, systemEntry.device, systemEntry.fs_type)))
|
||||
else:
|
||||
self.script.append(('run_program("/tmp/install/bin/backuptool.sh", "%s", "%s", "%s");' % (
|
||||
command, systemEntry.device, systemEntry.fs_type)))
|
||||
|
||||
def ShowProgress(self, frac, dur):
|
||||
"""Update the progress bar, advancing it over 'frac' over the next
|
||||
'dur' seconds. 'dur' may be zero to advance it via SetProgress
|
||||
|
@ -243,6 +262,17 @@ class EdifyGenerator(object):
|
|||
p.mount_point, mount_flags))
|
||||
self.mounts.add(p.mount_point)
|
||||
|
||||
def Unmount(self, mount_point):
|
||||
"""Unmount the partition with the given mount_point."""
|
||||
if mount_point in self.mounts:
|
||||
self.mounts.remove(mount_point)
|
||||
self.script.append('unmount("%s");' % (mount_point,))
|
||||
|
||||
def UnpackPackageDir(self, src, dst):
|
||||
"""Unpack a given directory from the OTA package into the given
|
||||
destination directory."""
|
||||
self.script.append('package_extract_dir("%s", "%s");' % (src, dst))
|
||||
|
||||
def Comment(self, comment):
|
||||
"""Write a comment into the update script."""
|
||||
self.script.append("")
|
||||
|
@ -381,6 +411,21 @@ class EdifyGenerator(object):
|
|||
assert not entry.slotselect, \
|
||||
"Use %s because %s is slot suffixed" % (fn, lst[1])
|
||||
|
||||
def SetPermissionsRecursive(self, fn, uid, gid, dmode, fmode, selabel,
|
||||
capabilities):
|
||||
"""Recursively set path ownership and permissions."""
|
||||
if capabilities is None:
|
||||
capabilities = "0x0"
|
||||
cmd = 'set_metadata_recursive("%s", "uid", %d, "gid", %d, ' \
|
||||
'"dmode", 0%o, "fmode", 0%o' \
|
||||
% (fn, uid, gid, dmode, fmode)
|
||||
if not fn.startswith("/tmp"):
|
||||
cmd += ', "capabilities", "%s"' % capabilities
|
||||
if selabel is not None:
|
||||
cmd += ', "selabel", "%s"' % selabel
|
||||
cmd += ');'
|
||||
self.script.append(cmd)
|
||||
|
||||
def WriteRawImage(self, mount_point, fn, mapfn=None):
|
||||
"""Write the given package file into the partition for the given
|
||||
mount point."""
|
||||
|
|
|
@ -49,13 +49,19 @@ def main(argv):
|
|||
|
||||
board_uses_vendorimage = OPTIONS.info_dict.get(
|
||||
"board_uses_vendorimage") == "true"
|
||||
board_builds_vendorimage = OPTIONS.info_dict.get(
|
||||
"board_builds_vendorimage") == "true"
|
||||
target_files_dir = None
|
||||
|
||||
if board_uses_vendorimage:
|
||||
if board_builds_vendorimage:
|
||||
target_files_dir = "VENDOR"
|
||||
else:
|
||||
target_files_dir = "SYSTEM"
|
||||
elif not board_uses_vendorimage:
|
||||
target_files_dir = "SYSTEM/vendor"
|
||||
|
||||
def output_sink(fn, data):
|
||||
if target_files_dir is None:
|
||||
return
|
||||
|
||||
with open(os.path.join(output_dir, target_files_dir,
|
||||
*fn.split("/")), "wb") as f:
|
||||
f.write(data)
|
||||
|
|
|
@ -109,6 +109,15 @@ def GetBlockDifferences(target_zip, source_zip, target_info, source_info,
|
|||
return block_diff_dict
|
||||
|
||||
|
||||
def CopyInstallTools(output_zip):
|
||||
install_path = os.path.join(OPTIONS.input_tmp, "INSTALL")
|
||||
for root, subdirs, files in os.walk(install_path):
|
||||
for f in files:
|
||||
install_source = os.path.join(root, f)
|
||||
install_target = os.path.join("install", os.path.relpath(root, install_path), f)
|
||||
output_zip.write(install_source, install_target)
|
||||
|
||||
|
||||
def WriteFullOTAPackage(input_zip, output_file):
|
||||
target_info = common.BuildInfo(OPTIONS.info_dict, OPTIONS.oem_dicts)
|
||||
|
||||
|
@ -143,9 +152,9 @@ def WriteFullOTAPackage(input_zip, output_file):
|
|||
assert HasRecoveryPatch(input_zip, info_dict=OPTIONS.info_dict)
|
||||
|
||||
# Assertions (e.g. downgrade check, device properties check).
|
||||
ts = target_info.GetBuildProp("ro.build.date.utc")
|
||||
ts_text = target_info.GetBuildProp("ro.build.date")
|
||||
script.AssertOlderBuild(ts, ts_text)
|
||||
#ts = target_info.GetBuildProp("ro.build.date.utc")
|
||||
#ts_text = target_info.GetBuildProp("ro.build.date")
|
||||
#script.AssertOlderBuild(ts, ts_text)
|
||||
|
||||
target_info.WriteDeviceAssertions(script, OPTIONS.oem_no_mount)
|
||||
device_specific.FullOTA_Assertions()
|
||||
|
@ -177,6 +186,8 @@ def WriteFullOTAPackage(input_zip, output_file):
|
|||
|
||||
recovery_img = common.GetBootableImage("recovery.img", "recovery.img",
|
||||
OPTIONS.input_tmp, "RECOVERY")
|
||||
common.CheckSize(recovery_img.data, "recovery.img", target_info)
|
||||
common.ZipWriteStr(output_zip, "recovery.img", recovery_img.data)
|
||||
if OPTIONS.two_step:
|
||||
if not target_info.get("multistage_support"):
|
||||
assert False, "two-step packages not supported by this build"
|
||||
|
@ -184,7 +195,6 @@ def WriteFullOTAPackage(input_zip, output_file):
|
|||
assert fs.fs_type.upper() == "EMMC", \
|
||||
"two-step packages only supported on devices with EMMC /misc partitions"
|
||||
bcb_dev = {"bcb_dev": fs.device}
|
||||
common.ZipWriteStr(output_zip, "recovery.img", recovery_img.data)
|
||||
script.AppendExtra("""
|
||||
if get_stage("%(bcb_dev)s") == "2/3" then
|
||||
""" % bcb_dev)
|
||||
|
@ -206,6 +216,14 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
|
|||
|
||||
device_specific.FullOTA_InstallBegin()
|
||||
|
||||
CopyInstallTools(output_zip)
|
||||
script.UnpackPackageDir("install", "/tmp/install")
|
||||
script.SetPermissionsRecursive("/tmp/install", 0, 0, 0o755, 0o644, None, None)
|
||||
script.SetPermissionsRecursive("/tmp/install/bin", 0, 0, 0o755, 0o755, None, None)
|
||||
|
||||
if OPTIONS.backuptool:
|
||||
script.RunBackup("backup", target_info.get('use_dynamic_partitions') == "true")
|
||||
|
||||
# All other partitions as well as the data wipe use 10% of the progress, and
|
||||
# the update of the system partition takes the remaining progress.
|
||||
system_progress = 0.9 - (len(block_diff_dict) - 1) * 0.1
|
||||
|
@ -215,12 +233,22 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
|
|||
progress_dict["system"] = system_progress
|
||||
|
||||
if target_info.get('use_dynamic_partitions') == "true":
|
||||
# Add non-sparse super empty image to OTA package if it exists
|
||||
if target_info.get('build_super_empty_partition') == "true":
|
||||
unsparse_super_empty_image_name = "unsparse_super_empty.img"
|
||||
unsparse_super_empty_image_path = os.path.join(OPTIONS.input_tmp, "IMAGES",
|
||||
unsparse_super_empty_image_name)
|
||||
unsparse_super_empty_image = common.File.FromLocalFile(
|
||||
unsparse_super_empty_image_name, unsparse_super_empty_image_path)
|
||||
common.ZipWriteStr(output_zip, unsparse_super_empty_image_name,
|
||||
unsparse_super_empty_image.data)
|
||||
# Use empty source_info_dict to indicate that all partitions / groups must
|
||||
# be re-added.
|
||||
dynamic_partitions_diff = common.DynamicPartitionsDifference(
|
||||
info_dict=OPTIONS.info_dict,
|
||||
block_diffs=block_diff_dict.values(),
|
||||
progress_dict=progress_dict)
|
||||
progress_dict=progress_dict,
|
||||
build_without_vendor=(not HasPartition(input_zip, "vendor")))
|
||||
dynamic_partitions_diff.WriteScript(script, output_zip,
|
||||
write_verify_script=OPTIONS.verify)
|
||||
else:
|
||||
|
@ -236,6 +264,12 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
|
|||
common.CheckSize(boot_img.data, "boot.img", target_info)
|
||||
common.ZipWriteStr(output_zip, "boot.img", boot_img.data)
|
||||
|
||||
device_specific.FullOTA_PostValidate()
|
||||
|
||||
if OPTIONS.backuptool:
|
||||
script.ShowProgress(0.02, 10)
|
||||
script.RunBackup("restore", target_info.get('use_dynamic_partitions') == "true")
|
||||
|
||||
script.WriteRawImage("/boot", "boot.img")
|
||||
|
||||
script.ShowProgress(0.1, 10)
|
||||
|
@ -676,12 +710,17 @@ def _WriteRecoveryImageToBoot(script, output_zip):
|
|||
|
||||
def HasRecoveryPatch(target_files_zip, info_dict):
|
||||
board_uses_vendorimage = info_dict.get("board_uses_vendorimage") == "true"
|
||||
board_builds_vendorimage = info_dict.get("board_builds_vendorimage") == "true"
|
||||
target_files_dir = None
|
||||
|
||||
if board_uses_vendorimage:
|
||||
if board_builds_vendorimage:
|
||||
target_files_dir = "VENDOR"
|
||||
else:
|
||||
elif not board_uses_vendorimage:
|
||||
target_files_dir = "SYSTEM/vendor"
|
||||
|
||||
if target_files_dir is None:
|
||||
return True
|
||||
|
||||
patch = "%s/recovery-from-boot.p" % target_files_dir
|
||||
img = "%s/etc/recovery.img" % target_files_dir
|
||||
|
||||
|
|
|
@ -144,6 +144,10 @@ Non-A/B OTA specific options
|
|||
that any changes made to the system partition are done using the new
|
||||
recovery (new kernel, etc.).
|
||||
|
||||
--backup <boolean>
|
||||
Enable or disable the execution of backuptool.sh.
|
||||
Disabled by default.
|
||||
|
||||
A/B OTA specific options
|
||||
|
||||
--disable_fec_computation
|
||||
|
@ -304,6 +308,7 @@ OPTIONS.worker_threads = multiprocessing.cpu_count() // 2
|
|||
if OPTIONS.worker_threads == 0:
|
||||
OPTIONS.worker_threads = 1
|
||||
OPTIONS.two_step = False
|
||||
OPTIONS.backuptool = False
|
||||
OPTIONS.include_secondary = False
|
||||
OPTIONS.block_based = True
|
||||
OPTIONS.updater_binary = None
|
||||
|
@ -1221,6 +1226,8 @@ def main(argv):
|
|||
"integers are allowed." % (a, o))
|
||||
elif o in ("-2", "--two_step"):
|
||||
OPTIONS.two_step = True
|
||||
elif o == "--backup":
|
||||
OPTIONS.backuptool = True
|
||||
elif o == "--include_secondary":
|
||||
OPTIONS.include_secondary = True
|
||||
elif o == "--no_signing":
|
||||
|
@ -1336,6 +1343,7 @@ def main(argv):
|
|||
"extra_script=",
|
||||
"worker_threads=",
|
||||
"two_step",
|
||||
"backup=",
|
||||
"include_secondary",
|
||||
"no_signing",
|
||||
"block",
|
||||
|
|
|
@ -45,7 +45,7 @@ OPTIONS.boot_variable_file = None
|
|||
|
||||
METADATA_NAME = 'META-INF/com/android/metadata'
|
||||
METADATA_PROTO_NAME = 'META-INF/com/android/metadata.pb'
|
||||
UNZIP_PATTERN = ['IMAGES/*', 'META/*', 'OTA/*',
|
||||
UNZIP_PATTERN = ['IMAGES/*', 'INSTALL/*', 'META/*', 'OTA/*',
|
||||
'RADIO/*', '*/build.prop', '*/default.prop', '*/build.default', "*/etc/vintf/*"]
|
||||
SECURITY_PATCH_LEVEL_PROP_NAME = "ro.build.version.security_patch"
|
||||
TARGET_FILES_IMAGES_SUBDIR = ["IMAGES", "PREBUILT_IMAGES", "RADIO"]
|
||||
|
@ -223,9 +223,13 @@ def UpdateDeviceState(device_state, build_info, boot_variable_values,
|
|||
partition_devices = set()
|
||||
partition_fingerprints = set()
|
||||
for runtime_build_info in build_info_set:
|
||||
partition_devices.add(
|
||||
runtime_build_info.GetPartitionBuildProp('ro.product.device',
|
||||
partition))
|
||||
try:
|
||||
partition_devices.add(
|
||||
runtime_build_info.GetPartitionBuildProp('ro.product.device',
|
||||
partition))
|
||||
except common.ExternalError:
|
||||
partition_devices.add(
|
||||
runtime_build_info.GetBuildProp('ro.product.device'))
|
||||
partition_fingerprints.add(
|
||||
runtime_build_info.GetPartitionFingerprint(partition))
|
||||
|
||||
|
|
|
@ -1221,6 +1221,7 @@ def BuildKeyMap(misc_info, key_mapping_options):
|
|||
devkeydir + "/platform": d + "/platform",
|
||||
devkeydir + "/networkstack": d + "/networkstack",
|
||||
devkeydir + "/sdk_sandbox": d + "/sdk_sandbox",
|
||||
devkeydir + "/bluetooth": d + "/bluetooth",
|
||||
})
|
||||
else:
|
||||
OPTIONS.key_map[s] = d
|
||||
|
|
Loading…
Reference in a new issue