-
Notifications
You must be signed in to change notification settings - Fork 5
/
releasetools.py
36 lines (29 loc) · 1.09 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
33
34
35
36
#
# Copyright (C) 2019 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
import common
def FullOTA_InstallEnd(info):
OTA_InstallEnd(info)
return
def IncrementalOTA_InstallEnd(info):
OTA_InstallEnd(info)
return
def AddImage(info, dir, basename, dest):
path = dir + "/" + basename
if path not in info.input_zip.namelist():
return
data = info.input_zip.read(path)
common.ZipWriteStr(info.output_zip, basename, data)
info.script.AppendExtra('package_extract_file("%s", "%s");' % (basename, dest))
def FullOTA_InstallBegin(info):
AddImage(info, "RADIO", "super_dummy.img", "/tmp/super_dummy.img");
info.script.AppendExtra('package_extract_file("install/bin/flash_super_dummy.sh", "/tmp/flash_super_dummy.sh");')
info.script.AppendExtra('set_metadata("/tmp/flash_super_dummy.sh", "uid", 0, "gid", 0, "mode", 0755);')
info.script.AppendExtra('run_program("/tmp/flash_super_dummy.sh");')
return
def OTA_InstallEnd(info):
info.script.Print("Patching device-tree and verity images...")
AddImage(info, "IMAGES", "vbmeta.img", "/dev/block/bootdevice/by-name/vbmeta")
return