Okay... lots of helpful information, excellent! stigmax2 and crm701, thank you both for testing and giving feedback. There are several different issues here:
- installations in TWRP (and maybe CWM, but perhaps no one uses it on this phone anymore)
- hroark13's KK rom boot loop
- superuser prompt issue
- maybe others, I'll think about them later.
- TWRP.
It looks like based on stigmax2's info, the first zip after getting into recovery works fine. Afterwards, something prevents the second one from working. If this hypothesis is right and this is the only cause of the problem, then one should be able to get into recovery (making sure internal /data is intact), flash the -copy zip, reboot back into recovery (again keeping internal /data intact), flash the -install zip, and reboot into rom. If there's no failure at each step, the hack should in theory work.
Next is to figure out why TWRP on this phone locks me out after my first zip is flashed. I have no such problems with v2.6.3.0 or CWM v6.0.4.8 on my Nook Color. TWRP allows queuing zips, so what happens when two or more zips are queued (-install first, followed by -uninstall, and then maybe even -copy just for kicks)? My guess is some file system becomes read-only. So please check this. Just after entering TWRP, do Advanced->Terminal Command->Select Folder->type "mount" in box then press enter. The output is a bunch of lines with each in this format: <device> on <mountpoint> type <fs_type> (<options>). I want to know the options for lines where <mountpoint> is "/" or "/tmp" or "/system" or "/data" (if they exist). For example, on my NC, the only such line is "rootfs on / type rootfs (rw)", so "/" has (rw). Next, go back to main menu and flash a zip, say -install. Then go back into Terminal Command again and press enter (it should run "mount" again). Check the lines again and let me know if any option is changed or if any such line is added.
I use TWRP 2.6.3.0, the way Hroark13 has it with the KK rom, you can boot into recovery using the 'home' button without wiping /data. It makes things a simpler. On KK 4.4.2 (Hroark13) w/ LG apps. So I believe you meant this for a ROM other than KitKat but I figured maybe it might help. I flashed dataOnSD-copy (success), rebooted TWRP (/data ok),flashed dataOnSD-install. Booted system and was bootlooped. Back into TWRP, flashed -uninstall, which produced a fail. Restored ROM.
I opened Terminal in TWRP, ran mount:
rootfs on / type rootfs (rw),
tmpfs on / dev type tmpfs (rw,seclabel,nosuid, relatime)
devpts on dev/pts type devpts (rw, seclabel,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw, seclabel, relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw, relatime)
dev/block/mmcblk0p14 on /cache type ext4 (rw, seclabel)
dev/block/mmcblk0p15 on /data type ext4 (rw,seclabel,)
dev/block/mmcblk0p15 on /emmc type ext4 (rw, seclabel, relatime, resuid=1000, data=ordered)
dev/block/mmcblk1p1 on /sdcard type vfat (rw,relatime)
After flashing dataonSD-install, no changes after running 'mount', bootloop on reboot.
- KK boot problem
I don't think the conflict is with KK per se, as the hack works on my NC's CM11. According to crm701, my old version didn't cause boot problems. Two things are different with this version. One, this version hijacks "vold" whereas the previous does "debuggerd". Two, the mounter is a binary rather than a shell script. To check whether "vold" vs. "debuggerd" is the problem, do the manual installation of the binary mount_data as in post #253, but in step 4, use "debuggerd" instead of "vold" (i.e. "debuggerd" -> "debuggerd-original" and "mount_data" -> "debuggerd"). No need for the copier script part. Check if using debuggerd causes a boot loop. If the rom still can't boot (and I suspect this is the case), then the cause is probably my binary in the rom's environment. To check that, I'd probably have to make a test binary that can output some debugging info. To check whether hijacking of "vold" causes a problem, use the script_caller binary and debuggerd script in post #220, except use "vold" instead of "debuggerd" (i.e. "vold" -> "vold-original" and "script_caller" -> "vold" and in /system/etc/DataOnSD, rename "debuggerd" to "vold"), and skip the "sensord" part.
I performed the above. I set permissions on mount_data, renamed 'debuggerd' and rebooted. Surprisingly, booted fine. Head scratcher? After reverting 'debuggerd' by removing '-original', and rebooting to make sure no loops, I did the steps using script_caller. /bin,set perms.,renamed 'vold'. DataonSD (set perms) in /etc, set perms. and renamed 'debuggerd' to 'vold'. This time system did the bootloop. Indicates a problem with vold?
-Superuser prompt issue
This conflict is likely a detection problem in my script. I'm trying to support the environment in stock rom, which has a very limited set of tools. At a command prompt after "su", what's the exact string returned by running "id"?
This one returned with uid=0(root), gid=0(root). To be thorough I ran the console (SManager) commands again. All OK up to (sh installer.sh both), which returns "not run as superuser/root". I tried putting 'su' instead of 'sh' which returns "tmp-mksh:both: not found". I tried (sh installer.sh binary), got the "not run as superuser/root".
All above done on Hroark13's KitKat 4.4.2 with LG apps, SD card fix (nextapp SD fix), Chainfire's SuperSU (comes with ROM).
If there are other issues, I'll have to deal with them later. The three above are more like show stoppers, so I hope I can resolve them quickly.
On a different note, on GT's Xperion rom (JB 4.1.2) mod works great, and I tried out Xposed and everything ran like it was supposed to. So there is that, which is awesome!
I might give this new version of the hack a spin on CM11, to see what results I get...