04-19-2015, 03:33 PM | #1 |
Junior Member
Posts: 8
Karma: 204
Join Date: Apr 2015
Location: United Kingdom
Device: m96
|
M96 - device encryption?
Hi all,
Just got my m96 recently from ereader-store. Long story short, I can't find a way to enable android device encryption. I'm vaguely familiar with the usb debugging and managed to pull this error from the log: Code:
Orig filesystem overlaps crypto footer region. Cannot encrypt in place. TIA |
04-21-2015, 08:29 AM | #2 |
Enthusiast
Posts: 27
Karma: 10
Join Date: Apr 2014
Device: kindle
|
What wish you read?
|
04-24-2015, 02:32 PM | #3 |
Junior Member
Posts: 8
Karma: 204
Join Date: Apr 2015
Location: United Kingdom
Device: m96
|
I did make *some* progress with this, I was able to force unmount the filesystem and reformat it to a slightly smaller size. Unfortunately the process is still failing and I haven't been able to pin down the source yet. I can post more details is anybody's interested!
A variety of things really, mostly technical documents, but also some personal documents (e-ink displays are great for proofreading!) hence encryption is desirable. |
06-09-2015, 02:20 PM | #4 |
Junior Member
Posts: 8
Karma: 204
Join Date: Apr 2015
Location: United Kingdom
Device: m96
|
I finally figured this one out!
The kernel was compiled without sha256 support, was able to compile that as a module against (roughly) compatible kernel sources I found here: http://git.freescale.com/git/ After that module is loaded, encryption completes. You can then add that module to the init.freescale.rc to make it load on boot. The only snag was that the touchscreen stopped responding after boot completed, just needed to restart 'onyx_tpd' after the crypto device is mounted, there are events for that in the init rc as well. maybe nobody cares but me, but I thought it might help someone someday! |
06-10-2015, 07:16 AM | #5 | |
Wizard
Posts: 1,138
Karma: 1577094
Join Date: Oct 2008
Device: Samsung EB60, Onyx M92, Onyx Max2
|
Quote:
I've too some papers for which the encryption will be useful. I'm not so clever as you in Linux system to debug hardware and Android, so could you give a copy of the modified files ? How do you restart the 'onyx_tpd' ? Some people here doesn't know, roughly, anything about the Android OS and Linux. If the module is small, could you attach the file ? If the like is broken, we have always the attached file. Last edited by Randy11; 06-10-2015 at 07:19 AM. |
|
06-12-2015, 03:30 PM | #6 |
Junior Member
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 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 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 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! |
06-15-2015, 06:44 AM | #7 |
Wizard
Posts: 1,138
Karma: 1577094
Join Date: Oct 2008
Device: Samsung EB60, Onyx M92, Onyx Max2
|
Thanks a lot for this beautiful explanation :-)
There is a lot of work ! |
06-15-2015, 03:57 PM | #8 |
Junior Member
Posts: 8
Karma: 204
Join Date: Apr 2015
Location: United Kingdom
Device: m96
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[M96] Perfect cover case for M96 | kuskro | Onyx Boox | 3 | 01-30-2015 12:28 PM |
Encryption of ebooks in Calibre | svenlind | Calibre | 14 | 04-16-2012 09:35 AM |
ePub encryption possible? | elielscott | ePub | 9 | 03-17-2012 09:08 AM |
re-encryption | therinken | Nook Developer's Corner | 1 | 02-27-2011 12:32 PM |
Email Encryption.. Do you use it? | Bob Russell | Lounge | 8 | 06-17-2006 04:33 AM |