forked from LiquidSmooth-Devices/android_device_htc_flounder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
releasetools.py
32 lines (29 loc) · 1.17 KB
/
releasetools.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import common
import struct
def FullOTA_InstallEnd(info):
try:
firmware_img = info.input_zip.read("RADIO/bootloader.img")
except KeyError:
print "no bootloader.img in target_files; skipping install"
else:
info.script.Print("Writing bootloader.img...")
common.ZipWriteStr(info.output_zip, "bootloader.img", firmware_img)
info.script.AppendExtra(
'package_extract_file("bootloader.img", "/dev/block/platform/sdhci-tegra.3/by-name/OTA");')
def IncrementalOTA_InstallEnd(info):
try:
source_firmware_img = info.source_zip.read("RADIO/bootloader.img")
except KeyError:
print "no bootloader.img in source_files; skipping install"
else:
try:
target_firmware_img = info.target_zip.read("RADIO/bootloader.img")
except KeyError:
print "no bootloader.img in target_files; skipping install"
else:
if source_firmware_img == target_firmware_img:
return
info.script.Print("Writing bootloader.img...")
common.ZipWriteStr(info.output_zip, "bootloader.img", target_firmware_img)
info.script.AppendExtra(
'package_extract_file("bootloader.img", "/dev/block/platform/sdhci-tegra.3/by-name/OTA");')