From 6103336eceb958dbd704d379fd19a7e2f9f139cb Mon Sep 17 00:00:00 2001 From: Jan Altensen Date: Tue, 3 Aug 2021 22:11:15 +0200 Subject: [PATCH] g12: dd dtb.img instead of using package_extract_file * for some reason its not getting flashed via package_extract_file Change-Id: Ia1bd4fa008dd0cde71baea63b48c6636ec85cb82 --- releasetools/releasetools.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/releasetools/releasetools.py b/releasetools/releasetools.py index eee7ccc..46adfb9 100644 --- a/releasetools/releasetools.py +++ b/releasetools/releasetools.py @@ -22,6 +22,11 @@ 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");'); + 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])) @@ -32,7 +37,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") - AddImage(info, "RADIO/", "dtb.img", "/dev/dtb") + FlashDtbImage(info) 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