diff options
-rw-r--r-- | core/Makefile | 52 | ||||
-rw-r--r-- | core/binary.mk | 11 | ||||
-rw-r--r-- | core/build_id.mk | 2 | ||||
-rw-r--r-- | core/combo/arch/arm/armv7-a-neon.mk | 2 | ||||
-rw-r--r-- | core/prebuilt_internal.mk | 2 | ||||
-rw-r--r-- | core/product_config.mk | 2 | ||||
-rw-r--r-- | core/qcom_target.mk | 9 | ||||
-rw-r--r-- | core/tasks/kernel.mk | 70 | ||||
-rw-r--r-- | core/version_defaults.mk | 2 | ||||
-rw-r--r-- | envsetup.sh | 52 | ||||
-rw-r--r-- | target/board/generic/sepolicy/property_contexts | 2 | ||||
-rw-r--r-- | target/product/core.mk | 1 | ||||
-rw-r--r-- | target/product/core_tiny.mk | 1 | ||||
-rw-r--r-- | target/product/emulator.mk | 3 | ||||
-rw-r--r-- | target/product/sdk_phone_arm64.mk | 2 | ||||
-rw-r--r-- | target/product/sdk_phone_armv7.mk | 2 | ||||
-rw-r--r-- | target/product/sdk_phone_mips.mk | 2 | ||||
-rw-r--r-- | target/product/sdk_phone_mips64.mk | 2 | ||||
-rw-r--r-- | target/product/sdk_phone_x86.mk | 2 | ||||
-rw-r--r-- | target/product/sdk_phone_x86_64.mk | 2 | ||||
-rw-r--r-- | tools/releasetools/common.py | 24 | ||||
-rw-r--r-- | tools/releasetools/edify_generator.py | 4 | ||||
-rwxr-xr-x | tools/releasetools/ota_from_target_files.py | 15 | ||||
-rw-r--r-- | tools/releasetools/sparse_img.py | 26 | ||||
-rwxr-xr-x | tools/repopick.py | 6 |
25 files changed, 207 insertions, 91 deletions
diff --git a/core/Makefile b/core/Makefile index 585b2e9..6cfbc2e 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1035,6 +1035,31 @@ $(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTIMG) $(recovery_ramdisk) $(recovery_k $(call build-recoveryimage-target, $@) endif # BOARD_CUSTOM_BOOTIMG_MK +# The system partition needs room for the recovery image as well. We +# now store the recovery image as a binary patch using the boot image +# as the source (since they are very similar). Generate the patch so +# we can see how big it's going to be, and include that in the system +# image size check calculation. +ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),) +intermediates := $(call intermediates-dir-for,PACKAGING,recovery_patch) +ifndef BOARD_CANT_BUILD_RECOVERY_FROM_BOOT_PATCH +RECOVERY_FROM_BOOT_PATCH := $(intermediates)/recovery_from_boot.p +else +RECOVERY_FROM_BOOT_PATCH := +endif +$(RECOVERY_FROM_BOOT_PATCH): $(INSTALLED_RECOVERYIMAGE_TARGET) \ + $(INSTALLED_BOOTIMAGE_TARGET) \ + $(HOST_OUT_EXECUTABLES)/imgdiff \ + $(HOST_OUT_EXECUTABLES)/bsdiff + @echo -e ${CL_CYN}"Construct recovery from boot"${CL_RST} + mkdir -p $(dir $@) +ifeq ($(TARGET_NOT_USE_GZIP_RECOVERY_RAMDISK),true) + PATH=$(HOST_OUT_EXECUTABLES):$$PATH $(HOST_OUT_EXECUTABLES)/bsdiff $(INSTALLED_BOOTIMAGE_TARGET) $(INSTALLED_RECOVERYIMAGE_TARGET) $@ +else + PATH=$(HOST_OUT_EXECUTABLES):$$PATH $(HOST_OUT_EXECUTABLES)/imgdiff $(INSTALLED_BOOTIMAGE_TARGET) $(INSTALLED_RECOVERYIMAGE_TARGET) $@ +endif +endif + recovery_patch_path := $(call intermediates-dir-for,PACKAGING,recovery_patch) ota_temp_root := $(PRODUCT_OUT)/ota_temp $(RECOVERY_PATCH_INSTALL): PRIVATE_RECOVERY_API_VERSION := $(RECOVERY_API_VERSION) @@ -1234,37 +1259,12 @@ $(BUILT_SYSTEMIMAGE): $(FULL_SYSTEMIMAGE_DEPS) $(INSTALLED_FILES_FILE) ifndef I_WANT_A_QUAIL_STAR $(BUILT_SYSTEMIMAGE): checkapi +$(BUILT_SYSTEMIMAGE): checkapi-cm endif INSTALLED_SYSTEMIMAGE := $(PRODUCT_OUT)/system.img SYSTEMIMAGE_SOURCE_DIR := $(TARGET_OUT) -# The system partition needs room for the recovery image as well. We -# now store the recovery image as a binary patch using the boot image -# as the source (since they are very similar). Generate the patch so -# we can see how big it's going to be, and include that in the system -# image size check calculation. -ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),) -intermediates := $(call intermediates-dir-for,PACKAGING,recovery_patch) -ifndef BOARD_CANT_BUILD_RECOVERY_FROM_BOOT_PATCH -RECOVERY_FROM_BOOT_PATCH := $(intermediates)/recovery_from_boot.p -else -RECOVERY_FROM_BOOT_PATCH := -endif -$(RECOVERY_FROM_BOOT_PATCH): $(INSTALLED_RECOVERYIMAGE_TARGET) \ - $(INSTALLED_BOOTIMAGE_TARGET) \ - $(HOST_OUT_EXECUTABLES)/imgdiff \ - $(HOST_OUT_EXECUTABLES)/bsdiff - @echo -e ${CL_CYN}"Construct recovery from boot"${CL_RST} - mkdir -p $(dir $@) -ifeq ($(TARGET_NOT_USE_GZIP_RECOVERY_RAMDISK),true) - PATH=$(HOST_OUT_EXECUTABLES):$$PATH $(HOST_OUT_EXECUTABLES)/bsdiff $(INSTALLED_BOOTIMAGE_TARGET) $(INSTALLED_RECOVERYIMAGE_TARGET) $@ -else - PATH=$(HOST_OUT_EXECUTABLES):$$PATH $(HOST_OUT_EXECUTABLES)/imgdiff $(INSTALLED_BOOTIMAGE_TARGET) $(INSTALLED_RECOVERYIMAGE_TARGET) $@ -endif -endif - - $(INSTALLED_SYSTEMIMAGE): $(BUILT_SYSTEMIMAGE) $(RECOVERY_FROM_BOOT_PATCH) | $(ACP) @echo -e ${CL_CYN}"Install system fs image: $@"${CL_RST} $(copy-file-to-target) diff --git a/core/binary.mk b/core/binary.mk index 88905d9..e25fb31 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -566,6 +566,17 @@ $(proto_generated_headers): $(proto_generated_sources_dir)/%.pb.h: $(proto_gener $(hide) touch $@ $(copy-proto-files) +$(if $(LOCAL_PROTOC_OUTPUT), \ +$(if $(call streq,$(LOCAL_PROTOC_OUTPUT),$(LOCAL_PATH)),, \ + $(eval proto_relocated_headers := $(subst $(LOCAL_PATH),$(LOCAL_PROTOC_OUTPUT),$(proto_generated_headers))) \ + ), ) + +ifdef proto_relocated_headers +$(proto_relocated_headers): $(proto_generated_headers) + echo "Refreshed header file $@." + $(hide) touch $@ +endif + $(my_prefix)_$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_proto_defined := true endif # transform-proto-to-cc rule included only once diff --git a/core/build_id.mk b/core/build_id.mk index f55b184..c2f0b28 100644 --- a/core/build_id.mk +++ b/core/build_id.mk @@ -18,4 +18,4 @@ # (like "CRB01"). It must be a single word, and is # capitalized by convention. -export BUILD_ID=MMB29U +export BUILD_ID=MHC19J diff --git a/core/combo/arch/arm/armv7-a-neon.mk b/core/combo/arch/arm/armv7-a-neon.mk index 9154f71..89e6573 100644 --- a/core/combo/arch/arm/armv7-a-neon.mk +++ b/core/combo/arch/arm/armv7-a-neon.mk @@ -27,7 +27,7 @@ ifneq (,$(filter cortex-a8 scorpion,$(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT arch_variant_ldflags := \ -Wl,--fix-cortex-a8 else -ifeq ($(strip $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT)),cortex-a7) +ifneq (,$(filter cortex-a7 cortex-a53 cortex-a53.a57,$(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT))) arch_variant_cflags := -mcpu=cortex-a7 -mfpu=neon-vfpv4 arch_variant_ldflags := \ -Wl,--no-fix-cortex-a8 diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index 585ead2..b5ff3a1 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -211,7 +211,9 @@ $(built_module): PRIVATE_EMBEDDED_JNI_LIBS := $(embedded_prebuilt_jni_libs) $(built_module) : $(my_prebuilt_src_file) | $(ACP) $(ZIPALIGN) $(SIGNAPK_JAR) $(transform-prebuilt-to-target) +ifneq ($(LOCAL_MODULE_PATH),$(TARGET_OUT_VENDOR)/bundled-app) $(uncompress-shared-libs) +endif ifneq ($(LOCAL_CERTIFICATE),PRESIGNED) @# Only strip out files if we can re-sign the package. ifdef LOCAL_DEX_PREOPT diff --git a/core/product_config.mk b/core/product_config.mk index 54050b4..259d983 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -117,7 +117,7 @@ ifdef product_goals # which really means TARGET_PRODUCT=dream make installclean. ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),) MAKECMDGOALS := $(MAKECMDGOALS) $(TARGET_BUILD_VARIANT) - TARGET_BUILD_VARIANT := eng + TARGET_BUILD_VARIANT := userdebug default_goal_substitution := else default_goal_substitution := $(DEFAULT_GOAL) diff --git a/core/qcom_target.mk b/core/qcom_target.mk index 5724a5b..092d832 100644 --- a/core/qcom_target.mk +++ b/core/qcom_target.mk @@ -13,8 +13,12 @@ endef # Set device-specific HALs into project pathmap define set-device-specific-path -$(call project-set-path,qcom-$(2),$(strip $(if $(USE_DEVICE_SPECIFIC_$(1)), \ - $(TARGET_DEVICE_DIR)/$(2), $(3)))) +$(if $(USE_DEVICE_SPECIFIC_$(1)), \ + $(if $(DEVICE_SPECIFIC_$(1)_PATH), \ + $(eval path := $(DEVICE_SPECIFIC_$(1)_PATH)), \ + $(eval path := $(TARGET_DEVICE_DIR)/$(2))), \ + $(eval path := $(3))) \ +$(call project-set-path,qcom-$(2),$(strip $(path))) endef ifeq ($(BOARD_USES_QCOM_HARDWARE),true) @@ -33,6 +37,7 @@ ifeq ($(BOARD_USES_QCOM_HARDWARE),true) qcom_flags += -DQCOM_BSP_LEGACY # Enable legacy audio functions ifeq ($(BOARD_USES_LEGACY_ALSA_AUDIO),true) + USE_CUSTOM_AUDIO_POLICY := 1 qcom_flags += -DLEGACY_ALSA_AUDIO endif endif diff --git a/core/tasks/kernel.mk b/core/tasks/kernel.mk index a3fa8a4..d8185b4 100644 --- a/core/tasks/kernel.mk +++ b/core/tasks/kernel.mk @@ -12,7 +12,44 @@ # See the License for the specific language governing permissions and # limitations under the License. + # Android makefile to build kernel as a part of Android Build +# +# Configuration +# ============= +# +# These config vars are usually set in BoardConfig.mk: +# +# TARGET_KERNEL_SOURCE = Kernel source dir, optional, defaults +# to kernel/$(TARGET_DEVICE_DIR) +# TARGET_KERNEL_CONFIG = Kernel defconfig +# TARGET_KERNEL_VARIANT_CONFIG = Variant defconfig, optional +# TARGET_KERNEL_SELINUX_CONFIG = SELinux defconfig, optional +# TARGET_KERNEL_ADDITIONAL_CONFIG = Additional defconfig, optional +# TARGET_KERNEL_ARCH = Kernel Arch +# TARGET_KERNEL_HEADER_ARCH = Optional Arch for kernel headers if +# different from TARGET_KERNEL_ARCH +# TARGET_USES_UNCOMPRESSED_KERNEL = 'true' if Kernel is uncompressed, +# optional, defaults to false +# TARGET_KERNEL_CROSS_COMPILE_PREFIX = Compiler prefix (e.g. aarch64-linux-android-) +# defaults to arm-eabi- +# +# BOARD_KERNEL_IMAGE_NAME = Built image name, optional, +# defaults to Image.gz on arm64 +# defaults to Image if TARGET_USES_UNCOMPRESSED_KERNEL +# defaults to zImage otherwise +# +# KERNEL_TOOLCHAIN_PREFIX = Overrides TARGET_KERNEL_CROSS_COMPILE_PREFIX, +# Set this var in shell to override +# toolchain specified in BoardConfig.mk +# KERNEL_TOOLCHAIN = Path to toolchain, if unset, assumes +# TARGET_KERNEL_CROSS_COMPILE_PREFIX +# is in PATH +# USE_CCACHE = Enable ccache (global Android flag) +# +# NEED_KERNEL_MODULE_ROOT = Optional, if true, install kernel +# modules in root instead of system + TARGET_AUTO_KDIR := $(shell echo $(TARGET_DEVICE_DIR) | sed -e 's/^device/kernel/g') @@ -159,33 +196,24 @@ else endif endif -ifeq ($(BOARD_HAS_MTK_HARDWARE),true) - ifeq ($(BOARD_USES_MTK_KERNELBUILD),true) - include $(CLEAR_VARS) - $(shell rm -f $(TARGET_PREBUILT_INT_KERNEL)) - FULL_KERNEL_BUILD := false - PROJECT_NAME := $(TARGET_KERNEL_CONFIG) -$(TARGET_PREBUILT_INT_KERNEL): - cd $(TARGET_KERNEL_SOURCE) && env -i PATH=$(PATH) ./makeMtk -t -o=OUT_DIR=$(OUT_DIR),TARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT) $(PROJECT_NAME) r k - -cd $(TARGET_KERNEL_SOURCE) && git clean -fd - - endif -endif - ifeq ($(FULL_KERNEL_BUILD),true) KERNEL_HEADERS_INSTALL := $(KERNEL_OUT)/usr KERNEL_HEADERS_INSTALL_STAMP := $(KERNEL_OUT)/.headers_install_stamp + +ifeq ($(NEED_KERNEL_MODULE_ROOT),true) +KERNEL_MODULES_INSTALL := root +KERNEL_MODULES_OUT := $(TARGET_ROOT_OUT)/lib/modules +else KERNEL_MODULES_INSTALL := system KERNEL_MODULES_OUT := $(TARGET_OUT)/lib/modules +endif TARGET_KERNEL_CROSS_COMPILE_PREFIX := $(strip $(TARGET_KERNEL_CROSS_COMPILE_PREFIX)) ifeq ($(TARGET_KERNEL_CROSS_COMPILE_PREFIX),) -ifeq ($(KERNEL_TOOLCHAIN_PREFIX),) -KERNEL_TOOLCHAIN_PREFIX := arm-none-eabi- -endif +KERNEL_TOOLCHAIN_PREFIX ?= arm-none-eabi- else -KERNEL_TOOLCHAIN_PREFIX := arm-none-eabi- +KERNEL_TOOLCHAIN_PREFIX ?= $(TARGET_KERNEL_CROSS_COMPILE_PREFIX) endif ifeq ($(KERNEL_TOOLCHAIN),) @@ -232,6 +260,7 @@ endif $(KERNEL_OUT_STAMP): $(hide) mkdir -p $(KERNEL_OUT) + $(hide) rm -rf $(KERNEL_MODULES_OUT) $(hide) mkdir -p $(KERNEL_MODULES_OUT) $(hide) touch $@ @@ -242,6 +271,7 @@ $(KERNEL_ADDITIONAL_CONFIG_OUT): force_additional_config $(hide) cmp -s $(KERNEL_ADDITIONAL_CONFIG_SRC) $@ || cp $(KERNEL_ADDITIONAL_CONFIG_SRC) $@; $(KERNEL_CONFIG): $(KERNEL_OUT_STAMP) $(KERNEL_DEFCONFIG_SRC) $(KERNEL_ADDITIONAL_CONFIG_OUT) + @echo -e ${CL_GRN}"Building Kernel Config"${CL_RST} $(MAKE) $(MAKE_FLAGS) -C $(KERNEL_SRC) O=$(KERNEL_OUT) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) VARIANT_DEFCONFIG=$(VARIANT_DEFCONFIG) SELINUX_DEFCONFIG=$(SELINUX_DEFCONFIG) $(KERNEL_DEFCONFIG) $(hide) if [ ! -z "$(KERNEL_CONFIG_OVERRIDE)" ]; then \ echo "Overriding kernel config with '$(KERNEL_CONFIG_OVERRIDE)'"; \ @@ -281,6 +311,7 @@ $(TARGET_PREBUILT_INT_KERNEL): $(TARGET_KERNEL_MODULES) $(clean-module-folder) $(KERNEL_HEADERS_INSTALL_STAMP): $(KERNEL_OUT_STAMP) $(KERNEL_CONFIG) + @echo -e ${CL_GRN}"Building Kernel Headers"${CL_RST} $(hide) if [ ! -z "$(KERNEL_HEADER_DEFCONFIG)" ]; then \ rm -f ../$(KERNEL_CONFIG); \ $(MAKE) -C $(KERNEL_SRC) O=$(KERNEL_OUT) ARCH=$(KERNEL_HEADER_ARCH) $(KERNEL_CROSS_COMPILE) VARIANT_DEFCONFIG=$(VARIANT_DEFCONFIG) SELINUX_DEFCONFIG=$(SELINUX_DEFCONFIG) $(KERNEL_HEADER_DEFCONFIG); \ @@ -308,10 +339,7 @@ kerneltags: $(KERNEL_OUT_STAMP) $(KERNEL_CONFIG) kernelconfig: KERNELCONFIG_MODE := menuconfig kernelxconfig: KERNELCONFIG_MODE := xconfig kernelxconfig kernelconfig: $(KERNEL_OUT_STAMP) - $(MAKE) $(MAKE_FLAGS) -C $(KERNEL_SRC) O=$(KERNEL_OUT) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) VARIANT_DEFCONFIG=$(VARIANT_DEFCONFIG) SELINUX_DEFCONFIG=$(SELINUX_DEFCONFIG) $(KERNEL_DEFCONFIG) - $(hide) if [ ! -z "$(KERNEL_CONFIG_OVERRIDE)" ]; then \ - echo "Overriding kernel config with '$(KERNEL_CONFIG_OVERRIDE)'"; \ - echo $(KERNEL_CONFIG_OVERRIDE) >> $(KERNEL_OUT)/.config; fi + $(MAKE) $(MAKE_FLAGS) -C $(KERNEL_SRC) O=$(KERNEL_OUT) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(KERNEL_DEFCONFIG) env KCONFIG_NOTIMESTAMP=true \ $(MAKE) -C $(KERNEL_SRC) O=$(KERNEL_OUT) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(KERNELCONFIG_MODE) env KCONFIG_NOTIMESTAMP=true \ diff --git a/core/version_defaults.mk b/core/version_defaults.mk index bf9b2e8..be5833d 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -103,7 +103,7 @@ ifeq "" "$(PLATFORM_SECURITY_PATCH)" # Can be an arbitrary string, but must be a single word. # # If there is no $PLATFORM_SECURITY_PATCH set, keep it empty. - PLATFORM_SECURITY_PATCH := 2016-02-01 + PLATFORM_SECURITY_PATCH := 2016-03-01 endif ifeq "" "$(PLATFORM_BASE_OS)" diff --git a/envsetup.sh b/envsetup.sh index bb46faf..91fdc6f 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -11,6 +11,7 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y To limit the modules being built use the syntax: mmm dir/:target1,target2. - mma: Builds all of the modules in the current directory, and their dependencies. - mmp: Builds all of the modules in the current directory and pushes them to the device. +- mmap: Builds all of the modules in the current directory, and its dependencies, then pushes the package to the device. - mmmp: Builds all of the modules in the supplied directories and pushes them to the device. - mmma: Builds all of the modules in the supplied directories, and their dependencies. - mms: Short circuit builder. Quickly re-build the kernel, rootfs, boot and system images @@ -855,7 +856,6 @@ function mm() local M=$(findmakefile) local MODULES= local GET_INSTALL_PATH= - local ARGS= # Remove the path to top as the makefilepath needs to be relative local M=`echo $M|sed 's:'$T'/::'` if [ ! "$T" ]; then @@ -872,12 +872,12 @@ function mm() done if [ -n "$GET_INSTALL_PATH" ]; then MODULES= - ARGS=GET-INSTALL-PATH + # set all args to 'GET-INSTALL-PATH' + set -- GET-INSTALL-PATH else MODULES=all_modules - ARGS=$@ fi - ONE_SHOT_MAKEFILE=$M $DRV make -C $T -f build/core/main.mk $MODULES $ARGS + ONE_SHOT_MAKEFILE=$M $DRV make -C $T -f build/core/main.mk $MODULES "$@" fi fi } @@ -892,8 +892,15 @@ function mmm() local ARGS= local DIR TO_CHOP local GET_INSTALL_PATH= - local DASH_ARGS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^-.*$/') - local DIRS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^[^-].*$/') + + if [ "$(__detect_shell)" = "zsh" ]; then + set -lA DASH_ARGS $(echo "$@" | awk -v RS=" " -v ORS=" " '/^-.*$/') + set -lA DIRS $(echo "$@" | awk -v RS=" " -v ORS=" " '/^[^-].*$/') + else + local DASH_ARGS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^-.*$/') + local DIRS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^[^-].*$/') + fi + for DIR in $DIRS ; do MODULES=`echo $DIR | sed -n -e 's/.*:\(.*$\)/\1/p' | sed 's/,/ /'` if [ "$MODULES" = "" ]; then @@ -956,8 +963,13 @@ function mmma() local T=$(gettop) local DRV=$(getdriver $T) if [ "$T" ]; then - local DASH_ARGS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^-.*$/') - local DIRS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^[^-].*$/') + if [ "$(__detect_shell)" = "zsh" ]; then + set -lA DASH_ARGS $(echo "$@" | awk -v RS=" " -v ORS=" " '/^-.*$/') + set -lA DIRS $(echo "$@" | awk -v RS=" " -v ORS=" " '/^[^-].*$/') + else + local DASH_ARGS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^-.*$/') + local DIRS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^[^-].*$/') + fi local MY_PWD=`PWD= /bin/pwd` if [ "$MY_PWD" = "$T" ]; then MY_PWD= @@ -1811,7 +1823,7 @@ function makerecipe() { repo forall -c ' - if [ "$REPO_REMOTE" == "github" ] + if [ "$REPO_REMOTE" = "github" ] then pwd cmremote @@ -1821,6 +1833,12 @@ function makerecipe() { } function cmgerrit() { + + if [ "$(__detect_shell)" = "zsh" ]; then + # zsh does not define FUNCNAME, derive from funcstack + local FUNCNAME=$funcstack[1] + fi + if [ $# -eq 0 ]; then $FUNCNAME help return 1 @@ -2211,7 +2229,7 @@ function dopush() echo "Device Found." fi - if (adb shell getprop ro.cm.device | grep -q "$CM_BUILD") || [ "$FORCE_PUSH" == "true" ]; + if (adb shell getprop ro.cm.device | grep -q "$CM_BUILD") || [ "$FORCE_PUSH" = "true" ]; then # retrieve IP and PORT info if we're using a TCP connection TCPIPPORT=$(adb devices | egrep '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]+[^0-9]+' \ @@ -2328,6 +2346,7 @@ EOF alias mmp='dopush mm' alias mmmp='dopush mmm' +alias mmap='dopush mma' alias mkap='dopush mka' alias cmkap='dopush cmka' @@ -2446,16 +2465,25 @@ function make() mk_timer $(get_make_command) "$@" } -if [ "x$SHELL" != "x/bin/bash" ]; then +function __detect_shell() { case `ps -o command -p $$` in *bash*) + echo bash ;; *zsh*) + echo zsh ;; *) - echo "WARNING: Only bash and zsh are supported, use of other shell may lead to erroneous results" + echo unknown + return 1 ;; esac + return +} + + +if ! __detect_shell > /dev/null; then + echo "WARNING: Only bash and zsh are supported, use of other shell may lead to erroneous results" fi # Execute the contents of any vendorsetup.sh files we can find. diff --git a/target/board/generic/sepolicy/property_contexts b/target/board/generic/sepolicy/property_contexts index 09b9b06..a0a4020 100644 --- a/target/board/generic/sepolicy/property_contexts +++ b/target/board/generic/sepolicy/property_contexts @@ -1,2 +1,4 @@ qemu. u:object_r:qemu_prop:s0 +emu. u:object_r:qemu_prop:s0 +emulator. u:object_r:qemu_prop:s0 radio.noril u:object_r:radio_noril_prop:s0 diff --git a/target/product/core.mk b/target/product/core.mk index 3af85af..c340acd 100644 --- a/target/product/core.mk +++ b/target/product/core.mk @@ -33,7 +33,6 @@ PRODUCT_PACKAGES += \ DownloadProviderUi \ Email \ ExactCalculator \ - Exchange2 \ ExternalStorageProvider \ FusedLocation \ InputDevices \ diff --git a/target/product/core_tiny.mk b/target/product/core_tiny.mk index 9684b11..31e2ae3 100644 --- a/target/product/core_tiny.mk +++ b/target/product/core_tiny.mk @@ -58,6 +58,7 @@ PRODUCT_PACKAGES += \ javax.btobex \ keystore \ keystore.default \ + ld.mc \ libOpenMAXAL \ libOpenSLES \ libdownmix \ diff --git a/target/product/emulator.mk b/target/product/emulator.mk index 7394d4f..cca29ab 100644 --- a/target/product/emulator.mk +++ b/target/product/emulator.mk @@ -47,7 +47,8 @@ PRODUCT_PACKAGES += \ power.goldfish \ fingerprint.ranchu \ fingerprintd \ - sensors.ranchu + sensors.ranchu \ + e2fsck PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml \ diff --git a/target/product/sdk_phone_arm64.mk b/target/product/sdk_phone_arm64.mk index a0cf6c1..1d13b9e 100644 --- a/target/product/sdk_phone_arm64.mk +++ b/target/product/sdk_phone_arm64.mk @@ -24,7 +24,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk) $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_arm64/device.mk) # Overrides -PRODUCT_BRAND := generic_arm64 +PRODUCT_BRAND := Android PRODUCT_NAME := sdk_phone_arm64 PRODUCT_DEVICE := generic_arm64 PRODUCT_MODEL := Android SDK built for arm64 diff --git a/target/product/sdk_phone_armv7.mk b/target/product/sdk_phone_armv7.mk index aeb4940..a0fa049 100644 --- a/target/product/sdk_phone_armv7.mk +++ b/target/product/sdk_phone_armv7.mk @@ -17,6 +17,6 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk) # Overrides -PRODUCT_BRAND := generic +PRODUCT_BRAND := Android PRODUCT_NAME := sdk_phone_armv7 PRODUCT_DEVICE := generic diff --git a/target/product/sdk_phone_mips.mk b/target/product/sdk_phone_mips.mk index 818491f..d7217a0 100644 --- a/target/product/sdk_phone_mips.mk +++ b/target/product/sdk_phone_mips.mk @@ -22,7 +22,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk) # Overrides -PRODUCT_BRAND := generic_mips +PRODUCT_BRAND := Android PRODUCT_NAME := sdk_phone_mips PRODUCT_DEVICE := generic_mips PRODUCT_MODEL := Android SDK for Mips diff --git a/target/product/sdk_phone_mips64.mk b/target/product/sdk_phone_mips64.mk index afdb2a8..8ddcb58 100644 --- a/target/product/sdk_phone_mips64.mk +++ b/target/product/sdk_phone_mips64.mk @@ -23,7 +23,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk) # Overrides -PRODUCT_BRAND := generic_mips64 +PRODUCT_BRAND := Android PRODUCT_NAME := sdk_phone_mips64 PRODUCT_DEVICE := generic_mips64 PRODUCT_MODEL := Android SDK built for mips64 diff --git a/target/product/sdk_phone_x86.mk b/target/product/sdk_phone_x86.mk index 95c49ab..a58d26f 100644 --- a/target/product/sdk_phone_x86.mk +++ b/target/product/sdk_phone_x86.mk @@ -22,7 +22,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk) # Overrides -PRODUCT_BRAND := generic_x86 +PRODUCT_BRAND := Android PRODUCT_NAME := sdk_phone_x86 PRODUCT_DEVICE := generic_x86 PRODUCT_MODEL := Android SDK built for x86 diff --git a/target/product/sdk_phone_x86_64.mk b/target/product/sdk_phone_x86_64.mk index 69e37af..c39b274 100644 --- a/target/product/sdk_phone_x86_64.mk +++ b/target/product/sdk_phone_x86_64.mk @@ -23,7 +23,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk) # Overrides -PRODUCT_BRAND := generic_x86_64 +PRODUCT_BRAND := Android PRODUCT_NAME := sdk_phone_x86_64 PRODUCT_DEVICE := generic_x86_64 PRODUCT_MODEL := Android SDK built for x86_64 diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 4f8db79..26cc674 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -1402,7 +1402,8 @@ PARTITION_TYPES = { "squashfs": "EMMC", "ext2": "EMMC", "ext3": "EMMC", - "vfat": "EMMC" + "vfat": "EMMC", + "osip": "OSIP" } def GetTypeAndDevice(mount_point, info): @@ -1489,18 +1490,27 @@ fi 'bonus_args': bonus_args} # The install script location moved from /system/etc to /system/bin - # in the L release. Parse the init.rc file to find out where the + # in the L release. Parse init.*.rc files to find out where the # target-files expects it to be, and put it there. sh_location = "etc/install-recovery.sh" - try: - with open(os.path.join(input_dir, "BOOT", "RAMDISK", "init.rc")) as f: + found = False + init_rc_dir = os.path.join(input_dir, "BOOT", "RAMDISK") + init_rc_files = os.listdir(init_rc_dir) + for init_rc_file in init_rc_files: + if (not init_rc_file.startswith('init.') or + not init_rc_file.endswith('.rc')): + continue + + with open(os.path.join(init_rc_dir, init_rc_file)) as f: for line in f: m = re.match(r"^service flash_recovery /system/(\S+)\s*$", line) if m: sh_location = m.group(1) - print("putting script in", sh_location) + found = True break - except (OSError, IOError) as e: - print("failed to read init.rc: %s" % e) + if found: + break + + print("putting script in", sh_location) output_sink(sh_location, sh) diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py index 80b8a44..825a7eb 100644 --- a/tools/releasetools/edify_generator.py +++ b/tools/releasetools/edify_generator.py @@ -323,6 +323,10 @@ class EdifyGenerator(object): self.script.append( 'write_raw_image(package_extract_file("%(fn)s"), "%(device)s");' % args) + elif partition_type == "OSIP": + self.script.append( + 'write_osip_image(package_extract_file("%(fn)s"), "%(device)s");' + % args) elif partition_type == "EMMC": if mapfn: args["map"] = mapfn diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index ff0ccb9..bc40873 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -637,13 +637,14 @@ else if get_stage("%(bcb_dev)s") == "3/3" then if HasVendorPartition(input_zip): system_progress -= 0.1 - script.AppendExtra("if is_mounted(\"/data\") then") - script.ValidateSignatures("data") - script.AppendExtra("else") - script.Mount("/data") - script.ValidateSignatures("data") - script.Unmount("/data") - script.AppendExtra("endif;") + if not OPTIONS.wipe_user_data: + script.AppendExtra("if is_mounted(\"/data\") then") + script.ValidateSignatures("data") + script.AppendExtra("else") + script.Mount("/data") + script.ValidateSignatures("data") + script.Unmount("/data") + script.AppendExtra("endif;") if "selinux_fc" in OPTIONS.info_dict: WritePolicyConfig(OPTIONS.info_dict["selinux_fc"], output_zip) diff --git a/tools/releasetools/sparse_img.py b/tools/releasetools/sparse_img.py index 10022d0..fa4406c 100644 --- a/tools/releasetools/sparse_img.py +++ b/tools/releasetools/sparse_img.py @@ -212,6 +212,16 @@ class SparseImage(object): nonzero_blocks = [] reference = '\0' * self.blocksize + # Workaround for bug 23227672. For squashfs, we don't have a system.map. So + # the whole system image will be treated as a single file. But for some + # unknown bug, the updater will be killed due to OOM when writing back the + # patched image to flash (observed on lenok-userdebug MEA49). Prior to + # getting a real fix, we evenly divide the non-zero blocks into smaller + # groups (currently 1024 blocks or 4MB per group). + # Bug: 23227672 + MAX_BLOCKS_PER_GROUP = 1024 + nonzero_groups = [] + f = self.simg_f for s, e in remaining: for b in range(s, e): @@ -234,12 +244,22 @@ class SparseImage(object): nonzero_blocks.append(b) nonzero_blocks.append(b+1) - assert zero_blocks or nonzero_blocks or clobbered_blocks + if len(nonzero_blocks) >= MAX_BLOCKS_PER_GROUP: + nonzero_groups.append(nonzero_blocks) + # Clear the list. + nonzero_blocks = [] + + if nonzero_blocks: + nonzero_groups.append(nonzero_blocks) + nonzero_blocks = [] + + assert zero_blocks or nonzero_groups or clobbered_blocks if zero_blocks: out["__ZERO"] = rangelib.RangeSet(data=zero_blocks) - if nonzero_blocks: - out["__NONZERO"] = rangelib.RangeSet(data=nonzero_blocks) + if nonzero_groups: + for i, blocks in enumerate(nonzero_groups): + out["__NONZERO-%d" % i] = rangelib.RangeSet(data=blocks) if clobbered_blocks: out["__COPY"] = clobbered_blocks diff --git a/tools/repopick.py b/tools/repopick.py index 64db7bf..1840a56 100755 --- a/tools/repopick.py +++ b/tools/repopick.py @@ -255,7 +255,11 @@ if __name__ == '__main__': continue change = int(change) - review = [x for x in reviews if x['number'] == change][0] + review = next((x for x in reviews if x['number'] == change), None) + if review is None: + print('Change %d not found, skipping' % change) + continue + mergables.append({ 'subject': review['subject'], 'project': review['project'], |