From 44d5c9e2cf9f1ce0670be5bedd1e415cd5c3e739 Mon Sep 17 00:00:00 2001 From: kleidione Freitas Date: Thu, 24 Mar 2022 09:16:43 -0300 Subject: veux: Merge common tree to veux - Ref: https://github.com/xiaomi-sm6375-devs/android_device_xiaomi_sm6375-common Signed-off-by: kleidione --- releasetools.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 releasetools.py (limited to 'releasetools.py') 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 -- cgit v1.2.3