summaryrefslogtreecommitdiffstats
path: root/tools/releasetools/ota_from_target_files
diff options
context:
space:
mode:
authorChris Soyars <ctso@ctso.me>2010-12-23 00:44:33 +0100
committerAdnan Begovic <adnan@cyngn.com>2015-10-06 16:09:29 -0700
commitae9f61b6717553eff9295ca93a959000306381ee (patch)
tree9d8c80ae59cb286aadd2877d601c9776ecf21e59 /tools/releasetools/ota_from_target_files
parent119d3bb8667485d3fca648e01cabc7c08bb160b6 (diff)
downloadbuild-ae9f61b6717553eff9295ca93a959000306381ee.zip
build-ae9f61b6717553eff9295ca93a959000306381ee.tar.gz
build-ae9f61b6717553eff9295ca93a959000306381ee.tar.bz2
Add otapackage support for backuptool
Change-Id: I512554c579d444067cd3ccbb0e6946a5eb6bc964a
Diffstat (limited to 'tools/releasetools/ota_from_target_files')
-rwxr-xr-xtools/releasetools/ota_from_target_files15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files
index f883f8d..f55fcb3 100755
--- a/tools/releasetools/ota_from_target_files
+++ b/tools/releasetools/ota_from_target_files
@@ -84,6 +84,10 @@ Usage: ota_from_target_files [flags] input_target_files output_ota_package
Specifies the number of worker-threads that will be used when
generating patches for incremental updates (defaults to 3).
+ --backup <boolean>
+ Enable or disable the execution of backuptool.sh.
+ Disabled by default.
+
"""
import sys
@@ -122,6 +126,7 @@ OPTIONS.updater_binary = None
OPTIONS.oem_source = None
OPTIONS.fallback_to_full = True
OPTIONS.full_radio = False
+OPTIONS.backuptool = False
def MostPopularKey(d, default):
"""Given a dict, return the key corresponding to the largest
@@ -575,6 +580,9 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
device_specific.FullOTA_InstallBegin()
+ if OPTIONS.backuptool:
+ script.RunBackup("backup")
+
system_progress = 0.75
if OPTIONS.wipe_user_data:
@@ -646,6 +654,10 @@ else if get_stage("%(bcb_dev)s") == "3/3" then
common.CheckSize(boot_img.data, "boot.img", OPTIONS.info_dict)
common.ZipWriteStr(output_zip, "boot.img", boot_img.data)
+ if OPTIONS.backuptool:
+ script.ShowProgress(0.02, 10)
+ script.RunBackup("restore")
+
script.ShowProgress(0.05, 5)
script.WriteRawImage("/boot", "boot.img")
@@ -1529,6 +1541,8 @@ def main(argv):
OPTIONS.updater_binary = a
elif o in ("--no_fallback_to_full",):
OPTIONS.fallback_to_full = False
+ elif o in ("--backup"):
+ OPTIONS.backuptool = bool(a.lower() == 'true')
else:
return False
return True
@@ -1552,6 +1566,7 @@ def main(argv):
"oem_settings=",
"verify",
"no_fallback_to_full",
+ "backup=",
], extra_option_handler=option_handler)
if len(args) != 2: