diff options
author | kleidione Freitas <kleidione@gmail.com> | 2022-03-24 09:16:43 -0300 |
---|---|---|
committer | kleidione <kleidione@gmail.com> | 2022-11-09 17:29:16 -0300 |
commit | 44d5c9e2cf9f1ce0670be5bedd1e415cd5c3e739 (patch) | |
tree | 4516fedba0c65fda9e795d8737d08a7746d41e40 /releasetools.py | |
parent | 15eeafbf239f393fcb6ed1a719398e5b7bbd6a19 (diff) |
veux: Merge common tree to veux
- Ref:
https://github.com/xiaomi-sm6375-devs/android_device_xiaomi_sm6375-common
Signed-off-by: kleidione <kleidione@gmail.com>
Diffstat (limited to 'releasetools.py')
-rw-r--r-- | releasetools.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/releasetools.py b/releasetools.py new file mode 100644 index 0000000..56cbe0d --- /dev/null +++ b/releasetools.py @@ -0,0 +1,32 @@ +# +# Copyright (C) 2022 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): + path = "IMAGES/" + 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 OTA_InstallEnd(info): + info.script.Print("Patching firmware images...") + AddImage(info, "dtbo.img", "/dev/block/bootdevice/by-name/dtbo") + AddImage(info, "vbmeta.img", "/dev/block/bootdevice/by-name/vbmeta") + AddImage(info, "vbmeta_system.img", "/dev/block/bootdevice/by-name/vbmeta_system") + return |