ads

mercredi 16 septembre 2015

Android 'boot' partition - is there some kind of checksum?



Hello everyone, new user here from Montréal, Canada!

I have a question regarding the "boot" MTD device on this cheap gigabyte/proscan tablet (model: plt1066g) - When i try to write what looks like a perfectly valid boot file to the boot partition, the device freezes on the OEM (proscan) boot logo, just after adjusting the brightness. It never gets to the green trashcan/r2d2 that flashes for a second, or the android boot animation.

If i re-flash the original image that i dumped from the MTD device, it works fine, so i know it's not a problem with the flashing process or the flashing tool i'm using.

The aforementioned original boot image consists of the following parts at the following offsets:

Code:


10                0xA              LZMA compressed data, properties: 0x2E, dictionary size: 8388608 bytes, uncompressed size: 259087888 bytes
2048              0x800            uImage header, header size: 64 bytes, header CRC: 0xBA042549, created: Fri Aug  1 03:43:38 2014, image size: 3027415 bytes, Data Address: 0x80008000, Entry Point: 0x80008000, data CRC: 0x74A1309A, OS: Linux, CPU: ARM, image type: OS Kernel Image, compression type: lzma, image name: "Linux-3.0.8"
3031040          0x2E4000          gzip compressed data, was "ramdisk.cpio", from NTFS filesystem (NT), last modified: Fri Aug  1 04:24:34 2014, max compression


I simply extracted the cpio archive, modified the init.rc script in this archive, then re-generated the archive and wrote it at the correct offset in my new copy of the boot image. This new boot image now contains:

Code:


10                0xA              LZMA compressed data, properties: 0x2E, dictionary size: 8388608 bytes, uncompressed size: 259087888 bytes
2048              0x800            uImage header, header size: 64 bytes, header CRC: 0xBA042549, created: Fri Aug  1 03:43:38 2014, image size: 3027415 bytes, Data Address: 0x80008000, Entry Point: 0x80008000, data CRC: 0x74A1309A, OS: Linux, CPU: ARM, image type: OS Kernel Image, compression type: lzma, image name: "Linux-3.0.8"
3031040          0x2E4000          gzip compressed data, was "ramdisk.cpio", from Unix, last modified: Wed Sep 16 14:55:00 2015, max compression


.... so it's not a problem with the image file, or with the cpio archive contained in the file (i checked that as well), or - at least i think - not a problem with the added lines in the init.rc file. Which leads me to suspect that the only possibiliity is that there's somehow a checksum or some other kind of hash check being done on the partition - for example in that small unused section at the beginning of the partition/image. If that's the case, is there some documentation about the process, or at least some ready-made tool that would generate the proper hash check?

Thanks very much for any assistance.


/* edit */ Oh, i forgot to mention that this device is running Android 4.1.1.



Aucun commentaire:

Enregistrer un commentaire