diff options
-rw-r--r-- | core/Makefile | 12 | ||||
-rwxr-xr-x | tools/releasetools/ota_from_target_files.py | 21 |
2 files changed, 12 insertions, 21 deletions
diff --git a/core/Makefile b/core/Makefile index eb9d5fd..aff7821 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1838,6 +1838,8 @@ ifdef PRODUCT_DEFAULT_DEV_CERTIFICATE else $(hide) build/tools/getb64key.py $(DEFAULT_SYSTEM_DEV_CERTIFICATE).x509.pem > $(zip_root)/META/releasekey.txt endif + $(hide) echo "ota_override_device=$(OTA_SCRIPT_OVERRIDE_DEVICE)" >> $(zip_root)/META/misc_info.txt + $(hide) echo "ota_override_prop=$(OTA_SCRIPT_OVERRIDE_PROP)" >> $(zip_root)/META/misc_info.txt @# Zip everything up, preserving symlinks $(hide) (cd $(zip_root) && zip -qry ../$(notdir $@) .) @# Run fs_config on all the system, vendor, boot ramdisk, @@ -1892,15 +1894,15 @@ endif endif ifeq ($(TARGET_OTA_ASSERT_DEVICE),) - $(INTERNAL_OTA_PACKAGE_TARGET): override_device := auto + OTA_SCRIPT_OVERRIDE_DEVICE := auto else - $(INTERNAL_OTA_PACKAGE_TARGET): override_device := $(TARGET_OTA_ASSERT_DEVICE) + OTA_SCRIPT_OVERRIDE_DEVICE := $(TARGET_OTA_ASSERT_DEVICE) endif ifneq ($(TARGET_UNIFIED_DEVICE),) - $(INTERNAL_OTA_PACKAGE_TARGET): override_prop := --override_prop=true + OTA_SCRIPT_OVERRIDE_PROP := true ifeq ($(TARGET_OTA_ASSERT_DEVICE),) - $(INTERNAL_OTA_PACKAGE_TARGET): override_device := $(TARGET_DEVICE) + OTA_SCRIPT_OVERRIDE_DEVICE := $(TARGET_OTA_ASSERT_DEVICE) endif endif @@ -1910,7 +1912,6 @@ endif $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS) @echo "$(OTA_FROM_TARGET_SCRIPT)" > $(PRODUCT_OUT)/ota_script_path - @echo "$(override_device)" > $(PRODUCT_OUT)/ota_override_device @echo -e ${CL_YLW}"Package OTA:"${CL_RST}" $@" $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \ $(OTA_FROM_TARGET_SCRIPT) -v \ @@ -1918,7 +1919,6 @@ $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS) -p $(HOST_OUT) \ -k $(KEY_CERT_PAIR) \ --backup=$(backuptool) \ - --override_device=$(override_device) $(override_prop) \ $(if $(OEM_OTA_CONFIG), -o $(OEM_OTA_CONFIG)) \ $(BUILT_TARGET_FILES_PACKAGE) $@ diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index e483b1c..c2fbb1d 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -96,14 +96,6 @@ Usage: ota_from_target_files [flags] input_target_files output_ota_package --backup <boolean> Enable or disable the execution of backuptool.sh. Disabled by default. - - --override_device <device> - Override device-specific asserts. Can be a comma-separated list. - - --override_prop <boolean> - Override build.prop items with custom vendor init. - Enabled when TARGET_UNIFIED_DEVICE is defined in BoardConfig - """ from __future__ import print_function @@ -1629,10 +1621,6 @@ def main(argv): "a float" % (a, o)) elif o in ("--backup",): OPTIONS.backuptool = bool(a.lower() == 'true') - elif o in ("--override_device",): - OPTIONS.override_device = a - elif o in ("--override_prop",): - OPTIONS.override_prop = bool(a.lower() == 'true') else: return False return True @@ -1658,15 +1646,18 @@ def main(argv): "verify", "no_fallback_to_full", "stash_threshold=", - "backup=", - "override_device=", - "override_prop=" + "backup=" ], extra_option_handler=option_handler) if len(args) != 2: common.Usage(__doc__) sys.exit(1) + if "ota_override_device" in OPTIONS.info_dict: + OPTIONS.override_device = OPTIONS.info_dict.get("ota_override_device") + if "ota_override_prop" in OPTIONS.info_dict: + OPTIONS.override_prop = OPTIONS.info_dict.get("ota_override_prop") == "true" + if OPTIONS.extra_script is not None: OPTIONS.extra_script = open(OPTIONS.extra_script).read() |