-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreleasetools.py
30 lines (25 loc) · 910 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
30
#
# Copyright (C) 2023 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):
name = basename
data = info.input_zip.read("IMAGES/" + 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, "vbmeta.img", "/dev/block/platform/bootdevice/by-name/vbmeta")
AddImage(info, "vbmeta_system.img", "/dev/block/platform/bootdevice/by-name/vbmeta_system")
AddImage(info, "vbmeta_vendor.img", "/dev/block/platform/bootdevice/by-name/vbmeta_vendor")
AddImage(info, "dtbo.img", "/dev/block/platform/bootdevice/by-name/dtbo")
return