summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/Makefile6
-rw-r--r--core/board_config.mk2
-rw-r--r--core/clear_vars.mk3
-rw-r--r--core/config.mk4
-rw-r--r--core/product.mk5
-rw-r--r--core/sysprop.mk14
-rw-r--r--core/version_defaults.mk1
-rw-r--r--envsetup.sh49
-rw-r--r--target/product/aosp_product.mk2
-rw-r--r--target/product/full_base.mk8
-rw-r--r--target/product/full_base_telephony.mk6
-rw-r--r--target/product/mainline.mk41
-rwxr-xr-xtools/buildinfo.sh5
-rwxr-xr-xtools/post_process_props.py6
-rw-r--r--tools/releasetools/common.py10
-rw-r--r--tools/releasetools/edify_generator.py12
-rw-r--r--tools/releasetools/make_recovery_patch.py12
-rw-r--r--tools/releasetools/non_ab_ota.py9
18 files changed, 160 insertions, 35 deletions
diff --git a/core/Makefile b/core/Makefile
index d358be470b..32c0b216b5 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -4556,6 +4556,9 @@ endif
ifeq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true)
$(hide) echo "full_recovery_image=true" >> $@
endif
+ifdef BUILDING_VENDOR_IMAGE
+ $(hide) echo "board_builds_vendorimage=true" >> $@
+endif
ifdef BOARD_USES_VENDORIMAGE
$(hide) echo "board_uses_vendorimage=true" >> $@
endif
@@ -4683,6 +4686,9 @@ endif
ifeq ($(TARGET_FLATTEN_APEX),false)
$(hide) echo "target_flatten_apex=false" >> $@
endif
+ifneq ($(TARGET_OTA_ASSERT_DEVICE),)
+ $(hide) echo "ota_override_device=$(TARGET_OTA_ASSERT_DEVICE)" >> $@
+endif
.PHONY: misc_info
misc_info: $(INSTALLED_MISC_INFO_TARGET)
diff --git a/core/board_config.mk b/core/board_config.mk
index ea6ec1e4ec..f73b558b7f 100644
--- a/core/board_config.mk
+++ b/core/board_config.mk
@@ -157,6 +157,8 @@ endif
# ###############################################################
$(foreach v,$(_build_broken_var_list),$(eval $(v) :=))
BUILD_BROKEN_NINJA_USES_ENV_VARS :=
+BUILD_BROKEN_USES_BUILD_COPY_HEADERS := true
+BUILD_BROKEN_DUP_SYSPROP := true
# Boards may be defined under $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)
# or under vendor/*/$(TARGET_DEVICE). Search in both places, but
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index 9487e78121..294a2e8aaf 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -502,6 +502,9 @@ LOCAL_TEST_PACKAGE :=
full_android_manifest :=
non_system_module :=
+# Include any vendor specific clear_vars.mk file
+-include vendor/*/build/core/clear_vars.mk
+
# Trim MAKEFILE_LIST so that $(call my-dir) doesn't need to
# iterate over thousands of entries every time.
# Leave the current makefile to make sure we don't break anything
diff --git a/core/config.mk b/core/config.mk
index b19de7c84a..4d2c43d344 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -319,6 +319,10 @@ include $(BUILD_SYSTEM)/envsetup.mk
# See envsetup.mk for a description of SCAN_EXCLUDE_DIRS
FIND_LEAVES_EXCLUDES := $(addprefix --prune=, $(SCAN_EXCLUDE_DIRS) .repo .git)
+ifneq ($(ICE_BUILD),)
+include vendor/ice/target/board/BoardConfigICE.mk
+endif
+
# The build system exposes several variables for where to find the kernel
# headers:
# TARGET_DEVICE_KERNEL_HEADERS is automatically created for the current
diff --git a/core/product.mk b/core/product.mk
index d3b2e39521..d846998b1d 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -114,6 +114,9 @@ _product_single_value_vars :=
# Variables that are lists of values.
_product_list_vars :=
+# Add support to override build.prop values
+_product_list_vars += PRODUCT_BUILD_PROP_OVERRIDES
+
_product_single_value_vars += PRODUCT_NAME
_product_single_value_vars += PRODUCT_MODEL
@@ -600,9 +603,11 @@ _readonly_late_variables := \
# Modified internally in the build system
_readonly_late_variables += \
+ PRODUCT_CFI_INCLUDE_PATHS \
PRODUCT_COPY_FILES \
PRODUCT_DEX_PREOPT_NEVER_ALLOW_STRIPPING \
PRODUCT_DEX_PREOPT_BOOT_FLAGS \
+ PRODUCT_SOONG_NAMESPACES
_readonly_early_variables := $(filter-out $(_readonly_late_variables),$(_product_var_list))
diff --git a/core/sysprop.mk b/core/sysprop.mk
index 249212d1b9..a5a8f00905 100644
--- a/core/sysprop.mk
+++ b/core/sysprop.mk
@@ -30,6 +30,8 @@ POST_PROCESS_PROPS := $(HOST_OUT_EXECUTABLES)/post_process_props$(HOST_EXECUTABL
# $(1): Partition name
# $(2): Output file name
define generate-common-build-props
+ bash -c '\
+ $(or $(PRODUCT_BUILD_PROP_OVERRIDES),:);\
echo "####################################" >> $(2);\
echo "# from generate-common-build-props" >> $(2);\
echo "# These properties identify this partition image." >> $(2);\
@@ -42,10 +44,10 @@ define generate-common-build-props
echo "ro.product.$(1).name=$(PRODUCT_SYSTEM_NAME)" >> $(2);\
,\
echo "ro.product.$(1).brand=$(PRODUCT_BRAND)" >> $(2);\
- echo "ro.product.$(1).device=$(TARGET_DEVICE)" >> $(2);\
+ echo "ro.product.$(1).device=$${TARGET_DEVICE:-$(TARGET_DEVICE)}" >> $(2);\
echo "ro.product.$(1).manufacturer=$(PRODUCT_MANUFACTURER)" >> $(2);\
- echo "ro.product.$(1).model=$(PRODUCT_MODEL)" >> $(2);\
- echo "ro.product.$(1).name=$(TARGET_PRODUCT)" >> $(2);\
+ echo "ro.product.$(1).model=$${PRODUCT_MODEL:-$(PRODUCT_MODEL)}" >> $(2);\
+ echo "ro.product.$(1).name=$${TARGET_PRODUCT:-$(TARGET_PRODUCT)}" >> $(2);\
)\
$(if $(filter system vendor odm,$(1)),\
echo "ro.$(1).product.cpu.abilist=$(TARGET_CPU_ABI_LIST) " >> $(2);\
@@ -62,6 +64,7 @@ define generate-common-build-props
echo "ro.$(1).build.version.release=$(PLATFORM_VERSION_LAST_STABLE)" >> $(2);\
echo "ro.$(1).build.version.release_or_codename=$(PLATFORM_VERSION)" >> $(2);\
echo "ro.$(1).build.version.sdk=$(PLATFORM_SDK_VERSION)" >> $(2);\
+ ';\
endef
@@ -149,7 +152,7 @@ endif
ifeq ($(DEFAULT_SYSTEM_DEV_CERTIFICATE),build/make/target/product/security/testkey)
BUILD_KEYS := test-keys
else
-BUILD_KEYS := dev-keys
+BUILD_KEYS := release-keys
endif
BUILD_VERSION_TAGS += $(BUILD_KEYS)
BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS)))
@@ -234,6 +237,7 @@ $(gen_from_buildinfo_sh): $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) | $(B
$(hide) TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \
TARGET_BUILD_FLAVOR="$(TARGET_BUILD_FLAVOR)" \
TARGET_DEVICE="$(TARGET_DEVICE)" \
+ ICE_DEVICE="$(TARGET_DEVICE)" \
PRODUCT_DEFAULT_LOCALE="$(call get-default-product-locale,$(PRODUCT_LOCALES))" \
PRODUCT_DEFAULT_WIFI_CHANNELS="$(PRODUCT_DEFAULT_WIFI_CHANNELS)" \
BUILD_ID="$(BUILD_ID)" \
@@ -256,12 +260,14 @@ $(gen_from_buildinfo_sh): $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) | $(B
PLATFORM_VERSION_ALL_CODENAMES="$(PLATFORM_VERSION_ALL_CODENAMES)" \
PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION="$(PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION)" \
BUILD_VERSION_TAGS="$(BUILD_VERSION_TAGS)" \
+ BUILD_FINGERPRINT="$(BUILD_FINGERPRINT_FROM_FILE)" \
$(if $(OEM_THUMBPRINT_PROPERTIES),BUILD_THUMBPRINT="$(BUILD_THUMBPRINT_FROM_FILE)") \
TARGET_CPU_ABI_LIST="$(TARGET_CPU_ABI_LIST)" \
TARGET_CPU_ABI_LIST_32_BIT="$(TARGET_CPU_ABI_LIST_32_BIT)" \
TARGET_CPU_ABI_LIST_64_BIT="$(TARGET_CPU_ABI_LIST_64_BIT)" \
TARGET_CPU_ABI="$(TARGET_CPU_ABI)" \
TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \
+ $(PRODUCT_BUILD_PROP_OVERRIDES) \
bash $(BUILDINFO_SH) > $@
ifdef TARGET_SYSTEM_PROP
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index 9b18e07e13..94ae28bb28 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -248,7 +248,6 @@ ifndef PLATFORM_SECURITY_PATCH
# If there is no $PLATFORM_SECURITY_PATCH set, keep it empty.
PLATFORM_SECURITY_PATCH := 2022-04-05
endif
-.KATI_READONLY := PLATFORM_SECURITY_PATCH
ifndef PLATFORM_SECURITY_PATCH_TIMESTAMP
# Used to indicate the matching timestamp for the security patch string in PLATFORM_SECURITY_PATCH.
diff --git a/envsetup.sh b/envsetup.sh
index 253688236c..85545cde2a 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -44,6 +44,12 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y
- refreshmod: Refresh list of modules for allmod/gomod/pathmod/outmod/installmod.
- syswrite: Remount partitions (e.g. system.img) as writable, rebooting if necessary.
+EOF
+
+ __print_ice_functions_help
+
+cat <<EOF
+
Environment options:
- SANITIZE_HOST: Set to 'address' to use ASAN for all host modules.
- ANDROID_QUIET_BUILD: set to 'true' to display only the essential messages.
@@ -53,7 +59,7 @@ EOF
local T=$(gettop)
local A=""
local i
- for i in `cat $T/build/envsetup.sh | sed -n "/^[[:blank:]]*function /s/function \([a-z_]*\).*/\1/p" | sort | uniq`; do
+ for i in `cat $T/build/envsetup.sh $T/vendor/ice/build/envsetup.sh | sed -n "/^[[:blank:]]*function /s/function \([a-z_]*\).*/\1/p" | sort | uniq`; do
A="$A $i"
done
echo $A
@@ -64,8 +70,8 @@ function build_build_var_cache()
{
local T=$(gettop)
# Grep out the variable names from the script.
- cached_vars=(`cat $T/build/envsetup.sh | tr '()' ' ' | awk '{for(i=1;i<=NF;i++) if($i~/get_build_var/) print $(i+1)}' | sort -u | tr '\n' ' '`)
- cached_abs_vars=(`cat $T/build/envsetup.sh | tr '()' ' ' | awk '{for(i=1;i<=NF;i++) if($i~/get_abs_build_var/) print $(i+1)}' | sort -u | tr '\n' ' '`)
+ cached_vars=(`cat $T/build/envsetup.sh $T/vendor/ice/build/envsetup.sh | tr '()' ' ' | awk '{for(i=1;i<=NF;i++) if($i~/get_build_var/) print $(i+1)}' | sort -u | tr '\n' ' '`)
+ cached_abs_vars=(`cat $T/build/envsetup.sh $T/vendor/ice/build/envsetup.sh | tr '()' ' ' | awk '{for(i=1;i<=NF;i++) if($i~/get_abs_build_var/) print $(i+1)}' | sort -u | tr '\n' ' '`)
# Call the build system to dump the "<val>=<value>" pairs as a shell script.
build_dicts_script=`\builtin cd $T; build/soong/soong_ui.bash --dumpvars-mode \
--vars="${cached_vars[*]}" \
@@ -147,6 +153,13 @@ function check_product()
echo "Couldn't locate the top of the tree. Try setting TOP." >&2
return
fi
+ if (echo -n $1 | grep -q -e "^ice_") ; then
+ ICE_BUILD=$(echo -n $1 | sed -e 's/^ice_//g')
+ else
+ ICE_BUILD=
+ fi
+ export ICE_BUILD
+
TARGET_PRODUCT=$1 \
TARGET_BUILD_VARIANT= \
TARGET_BUILD_TYPE= \
@@ -360,7 +373,6 @@ function set_stuff_for_environment()
setpaths
set_sequence_number
- export ANDROID_BUILD_TOP=$(gettop)
# With this environment variable new GCC can apply colors to warnings/errors
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
}
@@ -697,12 +709,37 @@ function lunch()
return 1
fi
+ check_product $product
+ if [ $? -ne 0 ]
+ then
+ # if we can't find a product, try to grab it off our github
+ T=$(gettop)
+ cd $T > /dev/null
+ vendor/ice/build/tools/roomservice.py $product
+ cd - > /dev/null
+ check_product $product
+ else
+ T=$(gettop)
+ cd $T > /dev/null
+ vendor/ice/build/tools/roomservice.py $product true
+ cd - > /dev/null
+ fi
+
TARGET_PRODUCT=$product \
TARGET_BUILD_VARIANT=$variant \
TARGET_PLATFORM_VERSION=$version \
build_build_var_cache
if [ $? -ne 0 ]
then
+ echo
+ echo "** Don't have a product spec for: '$product'"
+ echo "** Do you have the right repo manifest?"
+ product=
+ fi
+
+ if [ -z "$product" -o -z "$variant" ]
+ then
+ echo
return 1
fi
export TARGET_PRODUCT=$(get_build_var TARGET_PRODUCT)
@@ -1910,3 +1947,7 @@ function showcommands() {
validate_current_shell
source_vendorsetup
addcompletions
+
+export ANDROID_BUILD_TOP=$(gettop)
+
+. $ANDROID_BUILD_TOP/vendor/ice/build/envsetup.sh
diff --git a/target/product/aosp_product.mk b/target/product/aosp_product.mk
index e396ad11ff..11fc912b54 100644
--- a/target/product/aosp_product.mk
+++ b/target/product/aosp_product.mk
@@ -36,5 +36,7 @@ PRODUCT_PACKAGES += \
# Telephony:
# Provide a APN configuration to GSI product
+ifeq ($(ICE_BUILD),)
PRODUCT_COPY_FILES += \
device/sample/etc/apns-full-conf.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/apns-conf.xml
+endif
diff --git a/target/product/full_base.mk b/target/product/full_base.mk
index a8e1e913f7..0fba0cfac2 100644
--- a/target/product/full_base.mk
+++ b/target/product/full_base.mk
@@ -42,16 +42,18 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
netutils-wrapper-1.0
+ifeq ($(ICE_BUILD),)
# Additional settings used in all AOSP builds
PRODUCT_VENDOR_PROPERTIES := \
ro.config.ringtone?=Ring_Synth_04.ogg \
ro.config.notification_sound?=pixiedust.ogg
-# Put en_US first in the list, so make it default.
-PRODUCT_LOCALES := en_US
-
# Get some sounds
$(call inherit-product-if-exists, frameworks/base/data/sounds/AllAudio.mk)
+endif
+
+# Put en_US first in the list, so make it default.
+PRODUCT_LOCALES := en_US
# Get a list of languages.
$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)
diff --git a/target/product/full_base_telephony.mk b/target/product/full_base_telephony.mk
index d8a54cd7f3..b531ded8e7 100644
--- a/target/product/full_base_telephony.mk
+++ b/target/product/full_base_telephony.mk
@@ -24,8 +24,12 @@ PRODUCT_VENDOR_PROPERTIES := \
ro.com.android.dataroaming?=true
PRODUCT_COPY_FILES := \
- device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml \
frameworks/native/data/etc/handheld_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/handheld_core_hardware.xml
+ifeq ($(ICE_BUILD),)
+PRODUCT_COPY_FILES += \
+ device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml
+endif
+
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony.mk)
diff --git a/target/product/mainline.mk b/target/product/mainline.mk
new file mode 100644
index 0000000000..ebb0990d86
--- /dev/null
+++ b/target/product/mainline.mk
@@ -0,0 +1,41 @@
+#
+# Copyright (C) 2019 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# This makefile is intended to serve as a base for completely AOSP based
+# mainline devices, It contain the mainline system partition and sensible
+# defaults for the system_ext, product and vendor partitions.
+$(call inherit-product, $(SRC_TARGET_DIR)/product/mainline_system.mk)
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system_ext.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_vendor.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_product.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system_ext.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_vendor.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_product.mk)
+
+$(call inherit-product, frameworks/base/data/sounds/AllAudio.mk)
+
+PRODUCT_PROPERTY_OVERRIDES += \
+ ro.config.ringtone=Ring_Synth_04.ogg \
+ ro.com.android.dataroaming=true \
+
+PRODUCT_PACKAGES += \
+ PhotoTable \
+ WallpaperPicker \
+
+ifeq ($(ICE_BUILD),)
+PRODUCT_COPY_FILES += device/sample/etc/apns-full-conf.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/apns-conf.xml
+endif
diff --git a/tools/buildinfo.sh b/tools/buildinfo.sh
index a79bf846d7..2abc108eba 100755
--- a/tools/buildinfo.sh
+++ b/tools/buildinfo.sh
@@ -49,9 +49,12 @@ if [ -n "$PRODUCT_DEFAULT_LOCALE" ] ; then
fi
echo "ro.wifi.channels=$PRODUCT_DEFAULT_WIFI_CHANNELS"
-echo "# Do not try to parse thumbprint"
+echo "# Do not try to parse fingerprint or thumbprint"
+echo "ro.build.fingerprint=$BUILD_FINGERPRINT"
if [ -n "$BUILD_THUMBPRINT" ] ; then
echo "ro.build.thumbprint=$BUILD_THUMBPRINT"
fi
+echo "ro.ice.device=$ICE_DEVICE"
+
echo "# end build properties"
diff --git a/tools/post_process_props.py b/tools/post_process_props.py
index efbf614fd5..76a8fcd334 100755
--- a/tools/post_process_props.py
+++ b/tools/post_process_props.py
@@ -28,9 +28,9 @@ PROP_VALUE_MAX = 91
# Put the modifications that you need to make into the */build.prop into this
# function.
def mangle_build_prop(prop_list):
- # If ro.debuggable is 1, then enable adb on USB by default
- # (this is for userdebug builds)
- if prop_list.get_value("ro.debuggable") == "1":
+ # If ro.adb.secure is 0, then enable adb on USB by default
+ # (this is for eng builds)
+ if prop_list.get_value("ro.adb.secure") == "0":
val = prop_list.get_value("persist.sys.usb.config")
if "adb" not in val:
if val == "":
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 745942b9ce..2f83015bb5 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -427,7 +427,7 @@ class BuildInfo(object):
"system_other"] = self._partition_fingerprints["system"]
# These two should be computed only after setting self._oem_props.
- self._device = self.GetOemProperty("ro.product.device")
+ self._device = info_dict.get("ota_override_device", self.GetOemProperty("ro.product.device"))
self._fingerprint = self.CalculateFingerprint()
check_fingerprint(self._fingerprint)
@@ -3481,12 +3481,10 @@ def MakeRecoveryPatch(input_dir, output_sink, recovery_img, boot_img,
# In this case, the output sink is rooted at VENDOR
recovery_img_path = "etc/recovery.img"
recovery_resource_dat_path = "VENDOR/etc/recovery-resource.dat"
- sh_dir = "bin"
else:
# In this case the output sink is rooted at SYSTEM
recovery_img_path = "vendor/etc/recovery.img"
recovery_resource_dat_path = "SYSTEM/vendor/etc/recovery-resource.dat"
- sh_dir = "vendor/bin"
if full_recovery_image:
output_sink(recovery_img_path, recovery_img.data)
@@ -3569,11 +3567,7 @@ fi
# The install script location moved from /system/etc to /system/bin in the L
# release. In the R release it is in VENDOR/bin or SYSTEM/vendor/bin.
- sh_location = os.path.join(sh_dir, "install-recovery.sh")
-
- logger.info("putting script in %s", sh_location)
-
- output_sink(sh_location, sh.encode())
+ output_sink("bin/install-recovery.sh", sh.encode())
class DynamicPartitionUpdate(object):
diff --git a/tools/releasetools/edify_generator.py b/tools/releasetools/edify_generator.py
index 033c02e60c..f8247ee196 100644
--- a/tools/releasetools/edify_generator.py
+++ b/tools/releasetools/edify_generator.py
@@ -137,11 +137,13 @@ class EdifyGenerator(object):
def AssertDevice(self, device):
"""Assert that the device identifier is the given string."""
- cmd = ('getprop("ro.product.device") == "%s" || '
- 'abort("E%d: This package is for \\"%s\\" devices; '
- 'this is a \\"" + getprop("ro.product.device") + "\\".");') % (
- device, common.ErrorCode.DEVICE_MISMATCH, device)
- self.script.append(cmd)
+ cmd = ('assert(' +
+ ' || \0'.join(['getprop("ro.product.device") == "%s" || getprop("ro.build.product") == "%s"'
+ % (i, i) for i in device.split(",")]) +
+ ' || abort("E%d: This package is for device: %s; ' +
+ 'this device is " + getprop("ro.product.device") + ".");' +
+ ');') % (common.ErrorCode.DEVICE_MISMATCH, device)
+ self.script.append(self.WordWrap(cmd))
def AssertSomeBootloader(self, *bootloaders):
"""Asert that the bootloader version is one of *bootloaders."""
diff --git a/tools/releasetools/make_recovery_patch.py b/tools/releasetools/make_recovery_patch.py
index 1497d69ed7..b52289b8a2 100644
--- a/tools/releasetools/make_recovery_patch.py
+++ b/tools/releasetools/make_recovery_patch.py
@@ -49,13 +49,19 @@ def main(argv):
board_uses_vendorimage = OPTIONS.info_dict.get(
"board_uses_vendorimage") == "true"
+ board_builds_vendorimage = OPTIONS.info_dict.get(
+ "board_builds_vendorimage") == "true"
+ target_files_dir = None
- if board_uses_vendorimage:
+ if board_builds_vendorimage:
target_files_dir = "VENDOR"
- else:
- target_files_dir = "SYSTEM"
+ elif not board_uses_vendorimage:
+ target_files_dir = "SYSTEM/vendor"
def output_sink(fn, data):
+ if target_files_dir is None:
+ return
+
with open(os.path.join(output_dir, target_files_dir,
*fn.split("/")), "wb") as f:
f.write(data)
diff --git a/tools/releasetools/non_ab_ota.py b/tools/releasetools/non_ab_ota.py
index 471ef252a3..195c7f7c05 100644
--- a/tools/releasetools/non_ab_ota.py
+++ b/tools/releasetools/non_ab_ota.py
@@ -671,12 +671,17 @@ def _WriteRecoveryImageToBoot(script, output_zip):
def HasRecoveryPatch(target_files_zip, info_dict):
board_uses_vendorimage = info_dict.get("board_uses_vendorimage") == "true"
+ board_builds_vendorimage = info_dict.get("board_builds_vendorimage") == "true"
+ target_files_dir = None
- if board_uses_vendorimage:
+ if board_builds_vendorimage:
target_files_dir = "VENDOR"
- else:
+ elif not board_uses_vendorimage:
target_files_dir = "SYSTEM/vendor"
+ if target_files_dir is None:
+ return True
+
patch = "%s/recovery-from-boot.p" % target_files_dir
img = "%s/etc/recovery.img" % target_files_dir