diff options
author | Doug Zongker <dougz@android.com> | 2010-09-03 12:32:27 -0700 |
---|---|---|
committer | Doug Zongker <dougz@android.com> | 2010-09-03 12:37:37 -0700 |
commit | 13e9ba981b536964b39fb85610166f8d6ad69b42 (patch) | |
tree | 9bb24ca6a6c0dbc63f0e2c2a46b4e28776aa42e9 /releasetools.py | |
parent | 484d2e04910747ca9130ca50edc21072bb546839 (diff) | |
download | device_samsung_crespo-13e9ba981b536964b39fb85610166f8d6ad69b42.tar.gz device_samsung_crespo-13e9ba981b536964b39fb85610166f8d6ad69b42.tar.bz2 device_samsung_crespo-13e9ba981b536964b39fb85610166f8d6ad69b42.zip |
add releasetools for OTA of radio and bootloader on crespo
Change-Id: I74ecebdbd84cd433bca2597c37fbf9981fd623d0
Diffstat (limited to 'releasetools.py')
-rw-r--r-- | releasetools.py | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/releasetools.py b/releasetools.py new file mode 100644 index 0000000..493f94f --- /dev/null +++ b/releasetools.py @@ -0,0 +1,64 @@ +# Copyright (C) 2010 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. + +import common + +def FullOTA_InstallEnd(info): + try: + bootloader_img = info.input_zip.read("RADIO/bootloader.img") + common.ZipWriteStr(info.output_zip, "bootloader.img", bootloader_img) + info.script.WriteRawImage("bootloader", "bootloader.img") + except KeyError: + print "no bootloader.img in target_files; skipping install" + + try: + radio_img = info.input_zip.read("RADIO/radio.img") + common.ZipWriteStr(info.output_zip, "radio.img", radio_img) + info.script.WriteRawImage("radio", "radio.img") + except KeyError: + print "no radio.img in target_files; skipping install" + +def IncrementalOTA_InstallEnd(info): + try: + target_bootloader_img = info.target_zip.read("RADIO/bootloader.img") + try: + source_bootloader_img = info.source_zip.read("RADIO/bootloader.img") + except KeyError: + source_bootloader_img = None + + if source_bootloader_img == target_bootloader_img: + print "bootloader unchanged; skipping" + else: + common.ZipWriteStr(info.output_zip, "bootloader.img", bootloader_img) + info.script.WriteRawImage("bootloader", "bootloader.img") + + except KeyError: + print "no bootloader.img 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 unchanged; skipping" + else: + # TODO: send radio image as binary patch + + common.ZipWriteStr(info.output_zip, "radio.img", radio_img) + info.script.WriteRawImage("radio", "radio.img") + except KeyError: + print "no radio.img in target target_files; skipping install" |