forked from lenovo-sm6225-devs/device_lenovo_sm6225-common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
releasetools.py
29 lines (24 loc) · 855 Bytes
/
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
#
# Copyright (C) 2020-2021 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
import common
import re
def FullOTA_InstallEnd(info):
OTA_InstallEnd(info)
return
def IncrementalOTA_InstallEnd(info):
OTA_InstallEnd(info)
return
def AddImage(info, basename, dest, sourcedir="IMAGES"):
name = basename
data = info.input_zip.read(sourcedir + "/" + basename)
common.ZipWriteStr(info.output_zip, name, data)
info.script.AppendExtra('package_extract_file("%s", "%s");' % (name, dest))
def OTA_InstallEnd(info):
info.script.Print("Patching firmware images...")
AddImage(info, "dtbo.img", "/dev/block/bootdevice/by-name/dtbo", "RADIO")
AddImage(info, "vbmeta.img", "/dev/block/bootdevice/by-name/vbmeta")
AddImage(info, "vbmeta_system.img", "/dev/block/bootdevice/by-name/vbmeta_system")
return