View Single Post
Old 06-12-2015, 03:30 PM   #6
zoidberg
Junior Member
zoidberg doesn't litterzoidberg doesn't litterzoidberg doesn't litter
 
Posts: 8
Karma: 204
Join Date: Apr 2015
Location: United Kingdom
Device: m96
Hi Randy, I was a bit brief before so I may as well document the whole thing more thoroughly now. TBH it got messy at times!

Before getting started, if you aren't already you'll wanna get acquainted with the Android Debug Bridge (adb), part of the Android SDK. You use it to connect to the device over a USB cable and run commands on it.

1.
The first problem, the 'Crypto Footer Region' business. I couldn't find a way to unmount the data partition at the time, but since my device was new, I could just deliberately screw it up with the 'dd' command so the OS couldn't use it when I restarted:
The command I used was
Code:
dd if=/dev/zero of=/dev/block/mmcblk0p7 bs=4k count=10000
.
If you do that it *will* corrupt your data, possibly beyond all hope of recovery. *Definitely* have a confirmed backup before trying anything like it!! Also make sure you get the right block device. (it's possible yours isn't mmcblk0p7, run 'mount' to check what gets mounted to 'data')

Once that was done it would let me re-format the filesystem to a slightly smaller size, by doing this:
Code:
mke2fs -T ext4 -L data /dev/block/mmcblk0p7 524031
. Once that's done, the encryption process can get a step further.

2.
Then there was another problem, something to do with the signal the android framework uses to tell the software it's ready to go with the encryption. I can't remember how I got to the bottom of that one, but the solution involved prying open the boot file from the last update.zip I used and modifying it to change a setting.
You can read more about that here: https://www.mobileread.com/forums/sho...d.php?t=244556
In there is the "init.rc" file I was talking about, at this point, uncommenting this setting got me a step further:
Code:
setprop vold.post_fs_data_done 1
3.
The last error is the sha256 one. After much searching and head scratching, I guessed that this was the problem and managed to compile the module (I'll attach it to this post!), here's a basic starter point on kernel compiling: https://source.android.com/source/building-kernels.html.
Using the kernel source from Freescale and the google's cross-compiler toolchain, I managed to build the module. The only additional steps are; when you're running the build configuration tool, select to modularise sha256, then when you're done, run
Code:
make CFLAGS_MODULE=-fno-pic modules
That cflags bit has something to do with stopping the system rejecting the module cos it wasn't build with *precisely* the same settings as the kernel.

Use adb to push the file onto the device then use the 'insmod' command to insert it. to make that permanent, try adding it to the end of the init.freescale.rc file, same idea as before.

Finally, the touchscreen thing: in init.rc, I added 'restart onyx_tpd' to the end of the 'vold.decrypt=trigger_restart_framework' and 'vold.decrypt=trigger_load_persist_props' sections, that did the trick.

You might have guessed; there was plenty of trial and error and educated guessing going on, still barely understand some of the stuff I actually did, so if anybody has any comments, they're welcome!

Worth mentioning; for all I know there are perfectly good reasons Onyx/Freescale built the software this way, so long term, who knows... Still, so far the system's been as stable as before, my long journey into the linuxy guts of android is over for now!
Attached Files
File Type: zip sha256_generic (armv7).ko.zip (5.0 KB, 156 views)
zoidberg is offline   Reply With Quote