[Advanced][GUIDE] How to disable force encrypt and speed up your nexus 6

rhcp011235

Developer
Developer
Joined
Nov 22, 2013
Messages
164
Reaction score
13
Website
www.temperedarmor.com
Well,

As I said, I bit the bullet with the nexus 9 and now I have the nexus 6 but of which I cannot even afford at the moment due to losing my job just before xmas.

First thing for me, was to disable the encryption to speed up this phone almost 200X fold.

I was looking at people posting repacked kernels and I am not really the type that says OK, and flashes and goes on. i want to know how/why and how I can do it myself.

Well, the answer is quite simple. This flag is inside the nexus9 boot.img (and the file inside the ramdisk)

the file name is = fstab.shamu (somehow some people are able to repack these images)

I picked to do it from source code.

So you would sync up to the latest for 5.0.1

your dir may vary but mine is =
/Volumes/Android/aosp/device/moto/shamu

This is the device folder and it contains the file we need to edit.

Code:
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK

#TODO: Add 'check' as fs_mgr_flags with data partition.
# Currently we dont have e2fsck compiled. So fs check would failed.

#<src>                                                <mnt_point>  <type>  <mnt_flags and options>                     <fs_mgr_flags>
/dev/block/platform/msm_sdcc.1/by-name/system         /system      ext4    ro,barrier=1                                wait
/dev/block/platform/msm_sdcc.1/by-name/userdata    /data        ext4    rw,discard,nosuid,nodev,noatime,nodiratime,noauto_da_alloc,nobarrier    wait,check,encryptable=/dev/block/platform/msm_sdcc.1/by-name/metadata
/dev/block/platform/msm_sdcc.1/by-name/cache       /cache       ext4    rw,noatime,nosuid,nodev,barrier=1,data=ordered   wait,check
/dev/block/platform/msm_sdcc.1/by-name/modem       /firmware    ext4    ro,barrier=1,context=u:object_r:firmware_file:s0    wait
/dev/block/platform/msm_sdcc.1/by-name/boot         /boot           emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/recovery     /recovery       emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/misc         /misc           emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/modem        /modem          emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/mdm1m9kefs1  /mdm1m9kefs1    emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/mdm1m9kefs2  /mdm1m9kefs2    emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/mdm1m9kefs3  /mdm1m9kefs3    emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/sbl1         /sbl1           emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/tz           /tz             emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/rpm          /rpm            emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/sdi          /sdi            emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/aboot        /aboot          emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/versions     /versions       emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/logo         /logo           emmc    defaults                                                        defaults

So simply by changing the force to encryptable fixes the issue.

now you go to your crooot (main android build system)

and you type in
. build/envsetup.sh
lunch aosp_shamu-userdebug
make -j 8 bootimage

after awhile you shall get a bootimage. and you can flash it to your nexus6 and you don't need to wait for people to post re-packs. you can just sync up + do as described and poof.

Now one other thing I noticed, The nexus6 kernel is prebuilt and so is the DTB. so you can only modify the ramdisk from AOSP level. I am assuming the real kernel is someplace else. I really have not looked for it since I don't really do kernel work. But, I found this odd, normally you build the kernel and all. Not in this case!

Hope this helps some. It helped me
 

FoxKat

Premium Member
Premium Member
Joined
Apr 2, 2010
Messages
14,651
Reaction score
4,703
Location
Pennsylvania
Current Phone Model
Droid Turbo 2 & Galaxy S7
Well,

As I said, I bit the bullet with the nexus 9 and now I have the nexus 6 but of which I cannot even afford at the moment due to losing my job just before xmas.

First thing for me, was to disable the encryption to speed up this phone almost 200X fold.

I was looking at people posting repacked kernels and I am not really the type that says OK, and flashes and goes on. i want to know how/why and how I can do it myself.

Well, the answer is quite simple. This flag is inside the nexus9 boot.img (and the file inside the ramdisk)

the file name is = fstab.shamu (somehow some people are able to repack these images)

I picked to do it from source code.

So you would sync up to the latest for 5.0.1

your dir may vary but mine is =
/Volumes/Android/aosp/device/moto/shamu

This is the device folder and it contains the file we need to edit.

Code:
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK

#TODO: Add 'check' as fs_mgr_flags with data partition.
# Currently we dont have e2fsck compiled. So fs check would failed.

#<src>                                                <mnt_point>  <type>  <mnt_flags and options>                     <fs_mgr_flags>
/dev/block/platform/msm_sdcc.1/by-name/system         /system      ext4    ro,barrier=1                                wait
/dev/block/platform/msm_sdcc.1/by-name/userdata    /data        ext4    rw,discard,nosuid,nodev,noatime,nodiratime,noauto_da_alloc,nobarrier    wait,check,encryptable=/dev/block/platform/msm_sdcc.1/by-name/metadata
/dev/block/platform/msm_sdcc.1/by-name/cache       /cache       ext4    rw,noatime,nosuid,nodev,barrier=1,data=ordered   wait,check
/dev/block/platform/msm_sdcc.1/by-name/modem       /firmware    ext4    ro,barrier=1,context=u:object_r:firmware_file:s0    wait
/dev/block/platform/msm_sdcc.1/by-name/boot         /boot           emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/recovery     /recovery       emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/misc         /misc           emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/modem        /modem          emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/mdm1m9kefs1  /mdm1m9kefs1    emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/mdm1m9kefs2  /mdm1m9kefs2    emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/mdm1m9kefs3  /mdm1m9kefs3    emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/sbl1         /sbl1           emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/tz           /tz             emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/rpm          /rpm            emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/sdi          /sdi            emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/aboot        /aboot          emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/versions     /versions       emmc    defaults                                                        defaults
/dev/block/platform/msm_sdcc.1/by-name/logo         /logo           emmc    defaults                                                        defaults

So simply by changing the force to encryptable fixes the issue.

now you go to your crooot (main android build system)

and you type in
. build/envsetup.sh
lunch aosp_shamu-userdebug
make -j 8 bootimage

after awhile you shall get a bootimage. and you can flash it to your nexus6 and you don't need to wait for people to post re-packs. you can just sync up + do as described and poof.

Now one other thing I noticed, The nexus6 kernel is prebuilt and so is the DTB. so you can only modify the ramdisk from AOSP level. I am assuming the real kernel is someplace else. I really have not looked for it since I don't really do kernel work. But, I found this odd, normally you build the kernel and all. Not in this case!

Hope this helps some. It helped me
And another win for @rhcp011235!


Only one problem when you post code as text, is that sometimes the HTML interpreter see something in the text and thinks its something else. In this case it saw a series of symbols and thought it was an emoticon. How we fix this is another question. Typically what you would do is place the symbols inside of quote marks or some other characters, or space them apart so that the system doesn't interpret it but I'm not sure how we could do that and still maintain the integrity of the text in the code file.

65fe38fc5c923a8c34dbd20e433a4b07.jpg
 
Last edited:
OP
R

rhcp011235

Developer
Developer
Joined
Nov 22, 2013
Messages
164
Reaction score
13
Website
www.temperedarmor.com
Too bad I did not post this with a second spot reserved. it seems with some carriers you cannot flash a AOSP built boot.img or it breaks some things. So far i have seen the custom boot.img break on sprint. (it breaks their OTA activation) - I assume there is some custom kernel config for sprint that AOSP does not build by default. FYI, the kernel in the AOSP build is pre-built, I have yet to figure out why and/or I have not seen anyone else post about this. Just a warning. To fix this, if you do run into it, just flash the old boot.img back and look for one that has been repacked. I have yet to see anyone post HOW they are repacking the images. Ive tried a few times and all result in no-boot both on nexus6 and nexus 9. Just wanted to give an update
 
OP
R

rhcp011235

Developer
Developer
Joined
Nov 22, 2013
Messages
164
Reaction score
13
Website
www.temperedarmor.com
And another win for @rhcp011235!


Only one problem when you post code as text, is that sometimes the HTML interpreter see something in the text and thinks its something else. In this case it saw a series of symbols and thought it was an emoticon. How we fix this is another question. Typically what you would do is place the symbols inside of quote marks or some other characters, or space them apart so that the system doesn't interpret it but I'm not sure how we could do that and still maintain the integrity of the text in the code file.

65fe38fc5c923a8c34dbd20e433a4b07.jpg

Did you try reading this from a computer rather then a phone? I think the phone just interrupts values as a emoji. Plus, i don't think many people are doing this on their mobile :) So i think we are good. heh
 

FoxKat

Premium Member
Premium Member
Joined
Apr 2, 2010
Messages
14,651
Reaction score
4,703
Location
Pennsylvania
Current Phone Model
Droid Turbo 2 & Galaxy S7
Did you try reading this from a computer rather then a phone? I think the phone just interrupts values as a emoji. Plus, i don't think many people are doing this on their mobile :) So i think we are good. heh

Yep, 4th line of code, u followed by a colon : and then the letter "O" and the phone thinks it's a :O :eek:
 
Top