Move make_recovery_path and sparse_img to modules.

These two tools are only used within build system, so not adding them
to otatools.zip.

Bug: 63866463
Test: TreeHugger
Test: Build a non-A/B target that calls make_recovery_patch.
Change-Id: Iaeddc98a2c4a27c6b49d91047500029e460db9e3
This commit is contained in:
Tao Bao 2019-08-06 23:21:23 -07:00
parent 7edc2b1994
commit e11a46000c
6 changed files with 27 additions and 8 deletions

View File

@ -3434,8 +3434,7 @@ ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION))
# (1): list of items like "system", "vendor", "product", "system_ext"
# return: map each item into a command ( wrapped in $$() ) that reads the size
define read-size-of-partitions
$(foreach image,$(call images-for-partitions,$(1)),$$( \
build/make/tools/releasetools/sparse_img.py --get_partition_size $(image)))
$(foreach image,$(call images-for-partitions,$(1)),$$($(SPARSE_IMG) --get_partition_size $(image)))
endef
# round result to BOARD_SUPER_PARTITION_ALIGNMENT
@ -3472,7 +3471,7 @@ check-all-partition-sizes: $(check_all_partition_sizes_file)
# Add image dependencies so that generated_*_image_info.txt are written before checking.
$(check_all_partition_sizes_file): \
build/make/tools/releasetools/sparse_img.py \
$(SPARSE_IMG) \
$(call images-for-partitions,$(BOARD_SUPER_PARTITION_PARTITION_LIST))
ifeq ($(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS),true)
@ -4018,9 +4017,8 @@ $(BUILT_TARGET_FILES_PACKAGE): \
$(SOONG_APEX_KEYS_FILE) \
$(SOONG_ZIP) \
$(HOST_OUT_EXECUTABLES)/fs_config \
$(HOST_OUT_EXECUTABLES)/imgdiff \
$(HOST_OUT_EXECUTABLES)/bsdiff \
$(HOST_OUT_EXECUTABLES)/care_map_generator \
$(MAKE_RECOVERY_PATCH) \
$(BUILD_IMAGE_SRCS) \
$(BUILT_ASSEMBLED_FRAMEWORK_MANIFEST) \
$(BUILT_ASSEMBLED_VENDOR_MANIFEST) \
@ -4179,7 +4177,7 @@ endif
ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
ifdef BUILDING_SYSTEM_IMAGE
$(hide) PATH=$(INTERNAL_USERIMAGES_BINARY_PATHS):$$PATH MKBOOTIMG=$(MKBOOTIMG) \
build/make/tools/releasetools/make_recovery_patch $(zip_root) $(zip_root)
$(MAKE_RECOVERY_PATCH) $(zip_root) $(zip_root)
endif # BUILDING_SYSTEM_IMAGE
endif
ifeq ($(AB_OTA_UPDATER),true)

View File

@ -576,7 +576,6 @@ NANOPB_SRCS := $(HOST_OUT_EXECUTABLES)/protoc-gen-nanopb
VTSC := $(HOST_OUT_EXECUTABLES)/vtsc$(HOST_EXECUTABLE_SUFFIX)
MKBOOTFS := $(HOST_OUT_EXECUTABLES)/mkbootfs$(HOST_EXECUTABLE_SUFFIX)
MINIGZIP := $(HOST_OUT_EXECUTABLES)/minigzip$(HOST_EXECUTABLE_SUFFIX)
BROTLI := $(HOST_OUT_EXECUTABLES)/brotli$(HOST_EXECUTABLE_SUFFIX)
ifeq (,$(strip $(BOARD_CUSTOM_MKBOOTIMG)))
MKBOOTIMG := $(HOST_OUT_EXECUTABLES)/mkbootimg$(HOST_EXECUTABLE_SUFFIX)
else
@ -608,7 +607,9 @@ CHECK_ELF_FILE := build/make/tools/check_elf_file.py
LPMAKE := $(HOST_OUT_EXECUTABLES)/lpmake$(HOST_EXECUTABLE_SUFFIX)
BUILD_IMAGE := $(HOST_OUT_EXECUTABLES)/build_image$(HOST_EXECUTABLE_SUFFIX)
BUILD_SUPER_IMAGE := $(HOST_OUT_EXECUTABLES)/build_super_image$(HOST_EXECUTABLE_SUFFIX)
MAKE_RECOVERY_PATCH := $(HOST_OUT_EXECUTABLES)/make_recovery_patch$(HOST_EXECUTABLE_SUFFIX)
OTA_FROM_TARGET_FILES := $(HOST_OUT_EXECUTABLES)/ota_from_target_files$(HOST_EXECUTABLE_SUFFIX)
SPARSE_IMG := $(HOST_OUT_EXECUTABLES)/sparse_img$(HOST_EXECUTABLE_SUFFIX)
PROGUARD_HOME := external/proguard
PROGUARD := $(PROGUARD_HOME)/bin/proguard.sh

View File

@ -114,6 +114,17 @@ python_binary_host {
],
}
python_binary_host {
name: "make_recovery_patch",
defaults: ["releasetools_binary_defaults"],
srcs: [
"make_recovery_patch.py",
],
libs: [
"releasetools_common",
],
}
python_binary_host {
name: "merge_builds",
defaults: ["releasetools_binary_defaults"],
@ -143,6 +154,16 @@ python_binary_host {
],
}
python_binary_host {
name: "sparse_img",
defaults: ["releasetools_binary_defaults"],
srcs: [
"rangelib.py",
"sparse_img.py",
],
main: "sparse_img.py",
}
python_defaults {
name: "releasetools_test_defaults",
srcs: [

View File

@ -1 +0,0 @@
make_recovery_patch.py

0
tools/releasetools/make_recovery_patch.py Executable file → Normal file
View File

0
tools/releasetools/sparse_img.py Executable file → Normal file
View File