From: Jan Altensen Date: Mon, 16 Aug 2021 16:25:17 +0000 (+0200) Subject: g12: actually add the dtb image to the zip X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=28932b0e7d2464af6ca7834899d9792be99e7220;p=GitHub%2FLineageOS%2FG12%2Fandroid_device_amlogic_g12-common.git g12: actually add the dtb image to the zip Change-Id: I0a601d0fb747b34c1571e996560316777fb9957c --- diff --git a/releasetools/releasetools.py b/releasetools/releasetools.py index 46adfb9..6f7afbd 100644 --- a/releasetools/releasetools.py +++ b/releasetools/releasetools.py @@ -22,11 +22,13 @@ def AddImage(info, folder, basename, dest): common.ZipWriteStr(info.output_zip, name, data) info.script.AppendExtra('package_extract_file("%s", "%s");' % (name, dest)) -def FlashDtbImage(info): - info.script.AppendExtra('package_extract_file("RADIO/dtb.img", "/tmp/dtb.img");'); +def AddDtbImage(info, folder, basename): + name = basename + data = info.input_zip.read(folder + basename) + common.ZipWriteStr(info.output_zip, name, data) + info.script.AppendExtra('package_extract_file("%s", "/tmp/dtb.img");' % name); info.script.AppendExtra('run_program("/system/bin/dd", "if=/tmp/dtb.img", "of=/dev/dtb", "bs=1k", "count=256");'); - def PrintInfo(info, dest): info.script.Print("Patching {} image unconditionally...".format(dest.split('/')[-1])) @@ -37,7 +39,7 @@ def OTA_InstallEnd(info): AddImage(info, "IMAGES/", "vbmeta.img", "/dev/block/by-name/vbmeta") if 'RADIO/dtb.img' in info.input_zip.namelist(): PrintInfo(info, "/dev/dtb") - FlashDtbImage(info) + AddDtbImage(info, "RADIO/", "dtb.img") if 'RADIO/logo.img' in info.input_zip.namelist(): PrintInfo(info, "/dev/block/by-name/logo") AddImage(info, "RADIO/", "logo.img", "/dev/block/by-name/logo")