ginkgo: Import releasetools.py

From: https://github.com/LineageOS/android_device_xiaomi_ginkgo/blob/lineage-20/releasetools.py

Change-Id: Ib15588cd928761af8d0c61163e1fbbb1830a8cf8
Signed-off-by: Skyblueborb <tomaszborbely0710@gmail.com>
This commit is contained in:
Skyblueborb
2025-03-27 16:49:37 +01:00
parent 91c8a39b8d
commit 999e9d5db0
2 changed files with 39 additions and 0 deletions

View File

@@ -31,5 +31,8 @@ TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop
# Recovery
TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.qcom
# Releasetools
TARGET_RELEASETOOLS_EXTENSIONS := $(DEVICE_PATH)
# Inherit from the proprietary version
include vendor/xiaomi/ginkgo/BoardConfigVendor.mk

36
releasetools.py Normal file
View File

@@ -0,0 +1,36 @@
#
# Copyright (C) 2019 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import common
def FullOTA_InstallEnd(info):
OTA_InstallEnd(info)
def IncrementalOTA_InstallEnd(info):
OTA_InstallEnd(info)
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 device-tree and verity images...")
AddImage(info, "dtbo.img", "/dev/block/bootdevice/by-name/dtbo")
AddImage(info, "vbmeta.img", "/dev/block/bootdevice/by-name/vbmeta")