summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-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
6 files changed, 32 insertions, 22 deletions
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