From 726553e5ce617056aff3796ef320b76db245ee67 Mon Sep 17 00:00:00 2001 From: Ken Sumrall Date: Wed, 4 Jan 2012 20:58:40 -0800 Subject: Tool to fix the fs_size in the crypto footer The GPT of HSPA Prime devices is incorrect when it comes from the factory. Flashing a new bootloader fixes the GPT, but if the user had already encrypted the device, the old size of the partition is recorded in the crypto footer. If the size if not updated, the device will not be able to boot after the OTA, so add a new command to fix the fs_size field in the crypto footer for Prime devices. Change-Id: Ied4b592973d3d5c36c478b7fb32d59ac9e9611b0 --- releasetools.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'releasetools.py') diff --git a/releasetools.py b/releasetools.py index 23581d6..056c7dc 100644 --- a/releasetools.py +++ b/releasetools.py @@ -32,6 +32,8 @@ def FullOTA_InstallEnd(info): else: WriteRadio(info, radio_img) + FsSizeFix(info) + def IncrementalOTA_VerifyEnd(info): try: target_radio_img = info.target_zip.read("RADIO/radio.img") @@ -74,6 +76,12 @@ def IncrementalOTA_InstallEnd(info): except KeyError: print "no radio.img in target target_files; skipping install" + FsSizeFix(info) + +def FsSizeFix(info): + info.script.Print("Fixing fs_size in crypto footer...") + info.script.AppendExtra('''assert(samsung.fs_size_fix());''') + def WriteBootloader(info, bootloader_img): common.ZipWriteStr(info.output_zip, "bootloader.img", bootloader_img) fstab = info.info_dict["fstab"] -- cgit v1.1