diff options
| author | Michael Bestas <mikeioannina@gmail.com> | 2017-01-01 18:45:41 +0200 |
|---|---|---|
| committer | Louis Popi <theh2o64@gmail.com> | 2017-01-07 19:17:33 +0100 |
| commit | 2df88b1d804779c231bd3b3a5442149b6d474e4d (patch) | |
| tree | f8e86f85ea327dfa1a0e5ed454e73fbc7edf58cb /releasetools.py | |
| parent | 6878315e3d93a0d51ce990d798d77b6feb2cb891 (diff) | |
releasetools: Allow asserting baseband version
Change-Id: I101c0f7497014a43bd4cc1e3261de352d5aa0c52
Diffstat (limited to 'releasetools.py')
| -rwxr-xr-x | releasetools.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/releasetools.py b/releasetools.py index 31bf958..f8b3810 100755 --- a/releasetools.py +++ b/releasetools.py @@ -48,10 +48,12 @@ def GetRadioFiles(z): return out def FullOTA_Assertions(info): + AddBasebandAssertion(info) AddTrustZoneAssertion(info) return def IncrementalOTA_Assertions(info): + AddBasebandAssertion(info) AddTrustZoneAssertion(info) return @@ -108,6 +110,20 @@ def FullOTA_InstallEnd(info): def IncrementalOTA_InstallEnd(info): InstallRadioFiles(info) +def AddBasebandAssertion(info): + # Presence of filesmap indicates packaged firmware + filesmap = LoadFilesMap(info.input_zip) + if filesmap != {}: + return + android_info = info.input_zip.read("OTA/android-info.txt") + m = re.search(r'require\s+version-baseband\s*=\s*(\S+)', android_info) + if m: + versions = m.group(1).split('|') + if len(versions) and '*' not in versions: + cmd = 'assert(cm.verify_baseband(' + ','.join(['"%s"' % baseband for baseband in versions]) + ') == "1");' + info.script.AppendExtra(cmd) + return + def AddTrustZoneAssertion(info): # Presence of filesmap indicates packaged firmware filesmap = LoadFilesMap(info.input_zip) |
