From 28932b0e7d2464af6ca7834899d9792be99e7220 Mon Sep 17 00:00:00 2001 From: Jan Altensen Date: Mon, 16 Aug 2021 18:25:17 +0200 Subject: [PATCH] g12: actually add the dtb image to the zip Change-Id: I0a601d0fb747b34c1571e996560316777fb9957c --- releasetools/releasetools.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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") -- 2.20.1