aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiogo Ferreira <diogo@underdev.org>2015-04-03 11:39:37 (GMT)
committerDiogo Ferreira <diogo@underdev.org>2015-04-03 11:51:17 (GMT)
commit91c1338bc0fb27b4f4219a512abc98418df76162 (patch)
treeaca4e1dc2f7ce53ac11a6526a0b4ff2e12ac85c5
parent6285eea2b3523cd3d2e951b608e4b852cca1ab9e (diff)
downloadandroid_build-stable/cm-11.0-XNG2S.zip
android_build-stable/cm-11.0-XNG2S.tar.gz
android_build-stable/cm-11.0-XNG2S.tar.bz2
build: Add the factorypackage targetstable/cm-11.0-XNG2Srefs/changes/27/3427/1
The build system generates several artifacts, among them update zips, OTAs and update packages for fastboot. Shipping devices typically need extra-special packages in order to fulfill factory automation requirements. This patches adds a "factorypackage" target that can be customized by devices by providing a script that converts target files into the desired format. The script path should be set into TARGET_RELEASETOOL_FACTORY_FROM_TARGET_SCRIPT. Change-Id: I993f12766c96274f096c5f6c6da5aaa32394abbc
-rw-r--r--core/Makefile30
1 files changed, 30 insertions, 0 deletions
diff --git a/core/Makefile b/core/Makefile
index 312a3c1..2059967 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1549,6 +1549,36 @@ $(INTERNAL_UPDATE_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS)
.PHONY: updatepackage
updatepackage: $(INTERNAL_UPDATE_PACKAGE_TARGET)
+# -----------------------------------------------------------------
+# The factory package
+
+name := $(TARGET_PRODUCT)-factory-$(FILE_NAME_TAG)
+
+INTERNAL_FACTORY_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip
+
+ifeq ($(TARGET_RELEASETOOLS_EXTENSIONS),)
+# default to common dir for device vendor
+$(INTERNAL_FACTORY_PACKAGE_TARGET): extensions := $(TARGET_DEVICE_DIR)/../common
+else
+$(INTERNAL_FACTORY_PACKAGE_TARGET): extensions := $(TARGET_RELEASETOOLS_EXTENSIONS)
+endif
+
+$(INTERNAL_FACTORY_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS)
+ @echo -e ${CL_YLW}"Package:"${CL_RST}" $@"
+ if [ -z $(TARGET_RELEASETOOL_FACTORY_FROM_TARGET_SCRIPT) ]; then \
+ echo "Error: Factory script is not defined by target"; \
+ exit 1; \
+ fi
+ MKBOOTIMG=$(BOARD_CUSTOM_BOOTIMG_MK) \
+ $(TARGET_RELEASETOOL_FACTORY_FROM_TARGET_SCRIPT) -v \
+ -s $(extensions) \
+ -p $(HOST_OUT) \
+ $(BUILT_TARGET_FILES_PACKAGE) $@
+
+.PHONY: factorypackage
+factorypackage: $(INTERNAL_FACTORY_PACKAGE_TARGET)
+
+
endif # recovery_fstab is defined
endif # TARGET_NO_KERNEL != true
endif # TARGET_DEVICE != generic*