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

Discussion in 'Motorola Nexus 6' started by rhcp011235, Dec 18, 2014.

  1. rhcp011235

    rhcp011235 Developer
    Developer

    Joined:
    Nov 22, 2013
    Messages:
    164
    Likes Received:
    20
    Trophy Points:
    18
    Ratings:
    +21
    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
     
    • Like Like x 1
  2. FoxKat

    FoxKat Premium Member
    Premium Member

    Joined:
    Apr 2, 2010
    Messages:
    14,806
    Likes Received:
    4,751
    Trophy Points:
    838
    Location:
    Pennsylvania
    Ratings:
    +5,290
    Current Phone Model:
    Droid Turbo 2 & Galaxy S7
    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.

    [​IMG]
     
    #2 FoxKat, Dec 18, 2014
    Last edited: Dec 18, 2014
  3. rhcp011235

    rhcp011235 Developer
    Developer

    Joined:
    Nov 22, 2013
    Messages:
    164
    Likes Received:
    20
    Trophy Points:
    18
    Ratings:
    +21
    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
     
  4. rhcp011235

    rhcp011235 Developer
    Developer

    Joined:
    Nov 22, 2013
    Messages:
    164
    Likes Received:
    20
    Trophy Points:
    18
    Ratings:
    +21
    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
     
  5. FoxKat

    FoxKat Premium Member
    Premium Member

    Joined:
    Apr 2, 2010
    Messages:
    14,806
    Likes Received:
    4,751
    Trophy Points:
    838
    Location:
    Pennsylvania
    Ratings:
    +5,290
    Current Phone Model:
    Droid Turbo 2 & Galaxy S7
    Yep, 4th line of code, u followed by a colon : and then the letter "O" and the phone thinks it's a :O :eek:
     
  6. rhcp011235

    rhcp011235 Developer
    Developer

    Joined:
    Nov 22, 2013
    Messages:
    164
    Likes Received:
    20
    Trophy Points:
    18
    Ratings:
    +21
    Heh yea. I guess it's something with the fourm code and mobile. Best to view with normal computer
     
Search tags for this page
android disable forceencrypt fstab
,
android encryptable cannot boot
,
android fstab encryptable
,
android fstab forceencrypt
,
force android to msm
,
forceencrypt
,

fstab forceencrypt

,
how to speed up nexus 6
,
nexus 6 force encrypt
,
remove force-encryption flag from fstab