Files
device_samsung_a71-common/releasetools/releasetools.py
Akhil Narang 5719c22ae0 a71-common: releasetools: be more clear about firmware image patching
* This looks very odd on most of the devices using this tree because nothing is being patched.
* Just mention which image is being flashed and only when it actually is.

Change-Id: I8a9061fd83d20c7f8141111902d3e2663f7a1783
2024-07-29 11:54:40 +02:00

28 lines
764 B
Python

#
# Copyright (C) 2024 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
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.Print("Patching {} image unconditionally...".format(dest.split('/')[-1]))
info.script.AppendExtra('package_extract_file("%s", "%s");' % (basename, dest))
def OTA_InstallEnd(info):
AddImage(info, "dtbo.img", "/dev/block/bootdevice/by-name/dtbo")
AddImage(info, "vbmeta.img", "/dev/block/bootdevice/by-name/vbmeta")