diff --git a/core/Makefile b/core/Makefile index 35c0f9e647..1286de813f 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1673,13 +1673,17 @@ ifneq ($(TARGET_UNIFIED_DEVICE),) endif endif +ifneq ($(OLD_OTA),true) + $(INTERNAL_OTA_PACKAGE_TARGET): block_ota := --block +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) MKBOOTIMG=$(MKBOOTIMG) \ $(OTA_FROM_TARGET_SCRIPT) -v \ - --block \ + $(block_ota) \ -p $(HOST_OUT) \ -k $(KEY_CERT_PAIR) \ --backup=$(backuptool) \ diff --git a/core/combo/arch/arm64/armv8-a.mk b/core/combo/arch/arm64/armv8-a.mk index edc0497eeb..d94f35baa5 100644 --- a/core/combo/arch/arm64/armv8-a.mk +++ b/core/combo/arch/arm64/armv8-a.mk @@ -1 +1,6 @@ arch_variant_cflags := + +ifeq ($(TARGET_CPU_CORTEX_A53),true) +arch_variant_ldflags := -Wl,--fix-cortex-a53-843419 \ + -Wl,--fix-cortex-a53-835769 +endif diff --git a/core/config.mk b/core/config.mk index 9f9c343409..7134994c53 100644 --- a/core/config.mk +++ b/core/config.mk @@ -561,6 +561,10 @@ DEX2OAT_TARGET_CPU_VARIANT := $(TARGET_CPU_VARIANT) DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES := default ifneq (,$(filter $(DEX2OAT_TARGET_CPU_VARIANT),cortex-a7 cortex-a15 krait denver generic cortex-a53)) DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES := div + ifneq (,$(filter $(DEX2OAT_TARGET_CPU_VARIANT),cortex-a53)) + DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES += needfix_835769 + DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES := $(subst $(space),$(comma),$(strip $(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES))) + endif endif ifdef TARGET_2ND_ARCH @@ -569,6 +573,10 @@ $(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT := $(TARGET_2ND_CPU_VARI $(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES := default ifneq (,$(filter $($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT),cortex-a7 cortex-a15 krait denver cortex-a53)) $(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES := div + ifneq (,$(filter $($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT),cortex-a53)) + DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES += needfix_835769 + DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES := $(subst $(space),$(comma),$(strip $(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES))) + endif endif endif diff --git a/core/main.mk b/core/main.mk index cea8327bc2..978c9e5a13 100644 --- a/core/main.mk +++ b/core/main.mk @@ -84,6 +84,9 @@ dont_bother_goals := clean clobber dataclean installclean \ ifneq ($(filter $(dont_bother_goals), $(MAKECMDGOALS)),) dont_bother := true endif +ifeq ($(MAKECMDGOALS),cleaner) +dont_bother := true +endif # Targets that provide quick help on the build system. include $(BUILD_SYSTEM)/help.mk @@ -324,10 +327,11 @@ endif user_variant := $(filter user userdebug,$(TARGET_BUILD_VARIANT)) enable_target_debugging := true +WITH_DEXPREOPT := false tags_to_install := ifneq (,$(user_variant)) # Target is secure in user builds. - ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1 + ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=0 ifeq ($(user_variant),userdebug) # Pick up some extra useful tools @@ -337,7 +341,7 @@ ifneq (,$(user_variant)) ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.lockprof.threshold=500 else # Disable debugging in plain user builds. - enable_target_debugging := + enable_target_debugging := true endif # Turn on Dalvik preoptimization for libdvm.so user builds, but only if not @@ -347,7 +351,7 @@ ifneq (,$(user_variant)) ifeq ($(DALVIK_VM_LIB),libdvm.so) ifeq ($(user_variant),user) ifeq ($(HOST_OS),linux) - WITH_DEXPREOPT := true + WITH_DEXPREOPT := false endif endif endif @@ -379,6 +383,7 @@ endif # !enable_target_debugging ifeq ($(TARGET_BUILD_VARIANT),eng) tags_to_install := debug eng +WITH_DEXPREOPT := false ifneq ($(filter ro.setupwizard.mode=ENABLED, $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))),) # Don't require the setup wizard on eng builds ADDITIONAL_BUILD_PROPERTIES := $(filter-out ro.setupwizard.mode=%,\ @@ -1054,14 +1059,19 @@ endif # samplecode in $(MAKECMDGOALS) .PHONY: findbugs findbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET) -.PHONY: clean -clean: +.PHONY: cleaner +cleaner: @rm -rf $(OUT_DIR)/* @echo -e ${CL_GRN}"Entire build directory removed."${CL_RST} .PHONY: clobber clobber: clean +.PHONY: clean +clean: + @rm -rf $(OUT_DIR)/target/product/*/ + @echo -e ${CL_GRN}"Working device build directory removed."${CL_RST} + # The rules for dataclean and installclean are defined in cleanbuild.mk. #xxx scrape this from ALL_MODULE_NAME_TAGS diff --git a/target/product/core.mk b/target/product/core.mk index e7a8d3d7fa..5338178acf 100644 --- a/target/product/core.mk +++ b/target/product/core.mk @@ -24,7 +24,6 @@ PRODUCT_PACKAGES += \ BasicDreams \ Browser \ Calculator \ - Calendar \ CalendarProvider \ CaptivePortalLogin \ CertInstaller \ @@ -32,8 +31,6 @@ PRODUCT_PACKAGES += \ DeskClock \ DocumentsUI \ DownloadProviderUi \ - Email \ - Exchange2 \ ExternalStorageProvider \ FusedLocation \ InputDevices \ @@ -41,12 +38,10 @@ PRODUCT_PACKAGES += \ Keyguard \ LatinIME \ ManagedProvisioning \ - PicoTts \ PacProcessor \ libpac \ PrintSpooler \ ProxyHandler \ - QuickSearchBox \ Settings \ SharedStorageBackup \ Telecom \ diff --git a/target/product/full_base.mk b/target/product/full_base.mk index 2ba2ced211..3364b1aef0 100644 --- a/target/product/full_base.mk +++ b/target/product/full_base.mk @@ -36,9 +36,6 @@ PRODUCT_AAPT_CONFIG := normal # Get some sounds $(call inherit-product-if-exists, frameworks/base/data/sounds/AllAudio.mk) -# Get the TTS language packs -$(call inherit-product-if-exists, external/svox/pico/lang/all_pico_languages.mk) - # Get a list of languages. $(call inherit-product, $(SRC_TARGET_DIR)/product/locales_full.mk) diff --git a/target/product/generic_no_telephony.mk b/target/product/generic_no_telephony.mk index e60e63c1fa..16c2b3be42 100644 --- a/target/product/generic_no_telephony.mk +++ b/target/product/generic_no_telephony.mk @@ -21,8 +21,6 @@ PRODUCT_PACKAGES := \ Bluetooth \ Camera2 \ Gallery2 \ - Email \ - Exchange2 \ MusicFX \ OneTimeInitializer \ Provision \ diff --git a/target/product/sdk_base.mk b/target/product/sdk_base.mk index 451c0b71a3..9a725a9380 100644 --- a/target/product/sdk_base.mk +++ b/target/product/sdk_base.mk @@ -87,14 +87,6 @@ $(call inherit-product-if-exists, frameworks/base/data/keyboards/keyboards.mk) $(call inherit-product-if-exists, frameworks/webview/chromium/chromium.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk) -# include available languages for TTS in the system image --include external/svox/pico/lang/PicoLangDeDeInSystem.mk --include external/svox/pico/lang/PicoLangEnGBInSystem.mk --include external/svox/pico/lang/PicoLangEnUsInSystem.mk --include external/svox/pico/lang/PicoLangEsEsInSystem.mk --include external/svox/pico/lang/PicoLangFrFrInSystem.mk --include external/svox/pico/lang/PicoLangItItInSystem.mk - # locale. en_US is both first and in alphabetical order to # ensure this is the default locale. PRODUCT_LOCALES := \ diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py index 29ccd62396..4d5ccbe042 100755 --- a/tools/releasetools/build_image.py +++ b/tools/releasetools/build_image.py @@ -244,6 +244,22 @@ def BuildImage(in_dir, prop_dict, out_file, build_command.extend(["-j", prop_dict["journal_size"]]) if "timestamp" in prop_dict: build_command.extend(["-T", str(prop_dict["timestamp"])]) + else: + #Timestamp not provided in property_dict. + #Lets try to find the build.prop file and get the timestamp from there + #instead + path = in_dir + "/build.prop" + if os.path.exists(path): + with open(path) as f: + lines = f.readlines() + for line in lines: + line = line.strip() + if line.startswith("ro.build.date.utc"): + name, value = line.split("=", 1) + print "read ro.build.date.utc from build.prop as ", value + build_command.extend(["-T", value]) + else: + print "unable to open build.prop file..Image will be built using system time" if fs_config is not None: build_command.extend(["-C", fs_config]) if block_list is not None: diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 55fdb2bdc0..ecc7ae8c08 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -851,6 +851,46 @@ def ReadFile(self): return result +def ZipWrite(zip_file, filename, arcname=None, perms=0o644, + compress_type=None): + import datetime + + # http://b/18015246 + # Python 2.7's zipfile implementation wrongly thinks that zip64 is required + # for files larger than 2GiB. We can work around this by adjusting their + # limit. Note that `zipfile.writestr()` will not work for strings larger than + # 2GiB. The Python interpreter sometimes rejects strings that large (though + # it isn't clear to me exactly what circumstances cause this). + # `zipfile.write()` must be used directly to work around this. + # + # This mess can be avoided if we port to python3. + saved_zip64_limit = zipfile.ZIP64_LIMIT + zipfile.ZIP64_LIMIT = (1 << 32) - 1 + + if compress_type is None: + compress_type = zip_file.compression + if arcname is None: + arcname = filename + + saved_stat = os.stat(filename) + + try: + # `zipfile.write()` doesn't allow us to pass ZipInfo, so just modify the + # file to be zipped and reset it when we're done. + os.chmod(filename, perms) + + # Use a fixed timestamp so the output is repeatable. + epoch = datetime.datetime.fromtimestamp(0) + timestamp = (datetime.datetime(2009, 1, 1) - epoch).total_seconds() + os.utime(filename, (timestamp, timestamp)) + + zip_file.write(filename, arcname=arcname, compress_type=compress_type) + finally: + os.chmod(filename, saved_stat.st_mode) + os.utime(filename, (saved_stat.st_atime, saved_stat.st_mtime)) + zipfile.ZIP64_LIMIT = saved_zip64_limit + + def ZipWriteStr(zip, filename, data, perms=0644, compression=None): # use a fixed timestamp so the output is repeatable. zinfo = zipfile.ZipInfo(filename=filename, diff --git a/tools/releasetools/img_from_target_files.py b/tools/releasetools/img_from_target_files.py index 4c41cd6f0e..dfe27b2d3e 100755 --- a/tools/releasetools/img_from_target_files.py +++ b/tools/releasetools/img_from_target_files.py @@ -165,7 +165,13 @@ def banner(s): finally: print "cleaning up..." + # http://b/18015246 + # See common.py for context. zipfile also refers to ZIP64_LIMIT during + # close() when it writes out the central directory. + saved_zip64_limit = zipfile.ZIP64_LIMIT + zipfile.ZIP64_LIMIT = (1 << 32) - 1 output_zip.close() + zipfile.ZIP64_LIMIT = saved_zip64_limit shutil.rmtree(OPTIONS.input_tmp) print "done."