Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a951ebf0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Move otatools-package from make to soong" into main

parents bf56966e 322b51b2
Loading
Loading
Loading
Loading
+0 −58
Original line number Diff line number Diff line
@@ -5743,64 +5743,6 @@ INTERNAL_OTATOOLS_FILES := \
.PHONY: otatools
otatools: $(INTERNAL_OTATOOLS_FILES)

# For each module, recursively resolve its host shared library dependencies. Then we have a full
# list of modules whose installed files need to be packed.
INTERNAL_OTATOOLS_MODULES_WITH_DEPS := \
  $(sort $(INTERNAL_OTATOOLS_MODULES) \
      $(foreach m,$(INTERNAL_OTATOOLS_MODULES),$(call get-all-shared-libs-deps,$(m))))

INTERNAL_OTATOOLS_PACKAGE_FILES := \
  $(filter $(HOST_OUT)/%,$(call module-installed-files,$(INTERNAL_OTATOOLS_MODULES_WITH_DEPS)))

INTERNAL_OTATOOLS_PACKAGE_FILES += \
  $(sort $(shell find build/make/target/product/security -type f -name "*.x509.pem" -o \
      -name "*.pk8"))

ifneq (,$(wildcard packages/modules))
INTERNAL_OTATOOLS_PACKAGE_FILES += \
  $(sort $(shell find packages/modules -type f -name "*.x509.pem" -o -name "*.pk8" -o -name \
      "key.pem"))
endif

ifneq (,$(wildcard device))
INTERNAL_OTATOOLS_PACKAGE_FILES += \
  $(sort $(shell find device $(wildcard vendor) -type f -name "*.pk8" -o -name "verifiedboot*" -o \
      -name "*.pem" -o -name "oem*.prop" -o -name "*.avbpubkey"))
endif
ifneq (,$(wildcard external/avb))
INTERNAL_OTATOOLS_PACKAGE_FILES += \
  $(sort $(shell find external/avb/test/data -type f -name "testkey_*.pem" -o \
      -name "atx_metadata.bin"))
endif

INTERNAL_OTATOOLS_RELEASETOOLS := \
  $(shell find build/make/tools/releasetools -name "*.pyc" -prune -o \
      \( -type f -o -type l \) -print | sort)

BUILT_OTATOOLS_PACKAGE := $(PRODUCT_OUT)/otatools.zip
$(BUILT_OTATOOLS_PACKAGE): PRIVATE_ZIP_ROOT := $(call intermediates-dir-for,PACKAGING,otatools)/otatools
$(BUILT_OTATOOLS_PACKAGE): PRIVATE_OTATOOLS_PACKAGE_FILES := $(INTERNAL_OTATOOLS_PACKAGE_FILES)
$(BUILT_OTATOOLS_PACKAGE): PRIVATE_OTATOOLS_RELEASETOOLS := $(INTERNAL_OTATOOLS_RELEASETOOLS)
$(BUILT_OTATOOLS_PACKAGE): $(INTERNAL_OTATOOLS_PACKAGE_FILES) $(INTERNAL_OTATOOLS_RELEASETOOLS)
$(BUILT_OTATOOLS_PACKAGE): $(SOONG_ZIP) $(ZIP2ZIP)
	@echo "Package OTA tools: $@"
	rm -rf $@ $(PRIVATE_ZIP_ROOT)
	mkdir -p $(dir $@)
	$(call copy-files-with-structure,$(PRIVATE_OTATOOLS_PACKAGE_FILES),$(HOST_OUT)/,$(PRIVATE_ZIP_ROOT))
	$(call copy-files-with-structure,$(PRIVATE_OTATOOLS_RELEASETOOLS),build/make/tools/,$(PRIVATE_ZIP_ROOT))
	cp $(SOONG_ZIP) $(ZIP2ZIP) $(MERGE_ZIPS) $(PRIVATE_ZIP_ROOT)/bin/
	$(SOONG_ZIP) -o $@ -C $(PRIVATE_ZIP_ROOT) -D $(PRIVATE_ZIP_ROOT)

$(call declare-1p-container,$(BUILT_OTATOOLS_PACKAGE),build)
$(call declare-container-license-deps,$(INTERNAL_OTATOOLS_PACKAGE_FILES) $(INTERNAL_OTATOOLS_RELEASETOOLS),$(BUILT_OTATOOLS_PACKAGE):)

.PHONY: otatools-package
otatools-package: $(BUILT_OTATOOLS_PACKAGE)

$(call dist-for-goals, otatools-package, \
  $(BUILT_OTATOOLS_PACKAGE) \
)

endif # build_otatools_package

# -----------------------------------------------------------------
+0 −1
Original line number Diff line number Diff line
@@ -1556,7 +1556,6 @@ else ifeq ($(TARGET_BUILD_UNBUNDLED),$(TARGET_BUILD_UNBUNDLED_IMAGE))
  # sources in a droidcore full build.

  $(call dist-for-goals, droidcore, \
    $(BUILT_OTATOOLS_PACKAGE) \
    $(APPCOMPAT_ZIP) \
  )

+4 −4
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ cc_genrule {
}

java_genrule_host {
    name: "otatools_package",
    name: "otatools-package",
    tools: ["merge_zips"],
    compile_multilib: "first",
    cmd: "$(location merge_zips) $(out) $(in)",
@@ -199,11 +199,11 @@ java_genrule_host {
        ":otatools_package_dep_libs",
        ":otatools_package_releasetools",
    ],
    // TODO: Rename as "otatools.zip" when the rest files are ready.
    out: ["otatools_temp.zip"],
    out: ["otatools.zip"],
    dist: {
        targets: [
            "otatools-package-temp",
            "droidcore",
            "otatools-package",
        ],
    },
}