Encryption vs. root
It seems like Moto has done something quite nasty to make coexistence of root and encrypted /data almost impossible. Current observations:
- You can have an unencrypted, rooted phone without any obvious issues.
- You cannot encrypt your phone while it is rooted (you get a encryption failed message immediately, suggesting to do a factory wipe but that is remedied by a hard power cycle, your data will still be there.
- Once you unroot, encryption suddenly works
- After encryption root is behaving very erratically, occasionally I got the device to boot with root after flashing supersu but on the next reboot it is lost again
- Manual setting chmod 6555 on daemonsu and su in CWM is useless, they lose the suid attribute on reboot
I have poked around in /system and the ramdisk and my current takeaway, unless I missed something big, this is triggered from a binary as none of the scripts seem to contain any code to mess with su.
Edit: I have a suspicion that it happens in /boot as booting to the system right after flashing in TWRP seems to work (first time round) whereas CWM style full reboots do not seem work.
Edit 2: That does not seem to be it, does not yield root reliably in TWRP either
Does anybody have a pointer on what is going on? Looks like custom ROMs might be needed, after all.