summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjessica <jessica_jong@asus.com>2012-09-21 17:03:38 -0700
committerRamanan Rajeswaran <ramanan@google.com>2012-09-25 09:06:54 -0700
commit421370d48dfb2d58696b23392bc356adf16cff72 (patch)
treef16492aa3133bf5a504c2937d158370140b1e2f3
parent525a644f6019d448376625666d11a1c98ec6ed2b (diff)
downloadtilapia-421370d48dfb2d58696b23392bc356adf16cff72.tar.gz
Support radio update through OTA
Change-Id: I225e3083bcc3e0b29c5780a9595b62a36daf5686
-rw-r--r--BoardConfig.mk2
-rw-r--r--releasetools.py84
2 files changed, 86 insertions, 0 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 0386ad6..11821cd 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -36,5 +36,7 @@ TARGET_RECOVERY_UI_LIB := librecovery_ui_tilapia
TARGET_RECOVERY_UPDATER_LIBS := librecovery_updater_tilapia
TARGET_RECOVERY_UPDATER_EXTRA_LIBS := libIMCdownload libPrgHandler
+TARGET_RELEASETOOLS_EXTENSIONS := device/asus/tilapia
+
-include vendor/asus/tilapia/BoardConfigVendor.mk
include device/asus/grouper/BoardConfigCommon.mk
diff --git a/releasetools.py b/releasetools.py
new file mode 100644
index 0000000..0d1d64d
--- /dev/null
+++ b/releasetools.py
@@ -0,0 +1,84 @@
+# Copyright (C) 2012 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.
+
+"""Emit extra commands needed for Group during OTA installation
+(installing the bootloader)."""
+
+import common
+
+def FullOTA_InstallEnd(info):
+ try:
+ bootloader_bin = info.input_zip.read("RADIO/bootloader.raw")
+ except KeyError:
+ print "no bootloader.raw in target_files; skipping install"
+ else:
+ WriteBootloader(info, bootloader_bin)
+
+ try:
+ radio_img = info.input_zip.read("RADIO/radio.img")
+ except KeyError:
+ print "no radio.img in target_files; skipping install"
+ else:
+ WriteRadio(info, radio_img)
+
+
+def IncrementalOTA_InstallEnd(info):
+ try:
+ target_bootloader_bin = info.target_zip.read("RADIO/bootloader.raw")
+ try:
+ source_bootloader_bin = info.source_zip.read("RADIO/bootloader.raw")
+ except KeyError:
+ source_bootloader_bin = None
+
+ if source_bootloader_bin == target_bootloader_bin:
+ print "bootloader unchanged; skipping"
+ else:
+ WriteBootloader(info, target_bootloader_bin)
+ except KeyError:
+ print "no bootloader.raw in target target_files; skipping install"
+
+ try:
+ target_radio_img = info.target_zip.read("RADIO/radio.img")
+ try:
+ source_radio_img = info.source_zip.read("RADIO/radio.img")
+ except KeyError:
+ source_radio_img = None
+
+ if source_radio_img == target_radio_img:
+ print "radio image unchanged; skipping"
+ else:
+ WriteRadio(info, target_radio_img)
+ except KeyError:
+ print "no radio.img in target_files; skipping install"
+
+
+def WriteBootloader(info, bootloader_bin):
+ common.ZipWriteStr(info.output_zip, "bootloader.raw", bootloader_bin)
+ fstab = info.info_dict["fstab"]
+
+ info.script.Print("Writing bootloader...")
+
+ info.script.AppendExtra('''package_extract_file("bootloader.raw", "%s");''' %
+ (fstab["/staging"].device,))
+
+def WriteRadio(info, radio_img):
+ common.ZipWriteStr(info.output_zip, "radio.img", radio_img)
+ fstab = info.info_dict["fstab"]
+
+ info.script.Print("Writing radio...")
+ info.script.AppendExtra("""assert(package_extract_file("radio.img", "%s"),
+ mount("ext4", "EMMC", "%s", "/radio"),
+ bach.update_modem("/radio/SAM_6260_ALL.fls"));""" %
+ (fstab["/radio"].device, fstab["/radio"].device))
+