[LG G Pro 2] pcfree:
Somthing about this project

HISTORY FOR DEVELOPING THIS PROJECT

After hacking the TOT file format to root D838 with ioroot (see my post [Tutorial] How to root D838 that cannot enter recovery mode), I start thinking of customizing my phone. Without custom recovery, it make me uncomfortable to hack system apks or try out Xposed. This leads to my first attempt.

1st Attempt -- Porting Loki-Friendly aboot.img

Initially, I want to port loki-friendly D802 JellyBean aboot.img to D838. If it successes, we would have custom recovery, custom kernel and custom ROM. Choosing D802 is because they use the same QualComm S800 chip and both com from LG. I studied the bootloader chain and tried to make lokified stock kernel with the help from xda Recognized Developer Savoca. I found the possibly best solution would be install D802 JB aboot.img and laf.img into D838 with a lokified custom-made rebuilt D838 stock kernel. However, I cannot make sure if my phone will survive from brick if the testing is failed.

If D838 KK sbl1.img (1st secondary bootloader) cannot accept D802 JB aboot.img, the phone will enter bulk device mode which can be recovered from brick in Linux PC. On the other hand, if D802 aboot.img is accepted to run but hang up due to other issues, the thing becomes more complicated. My D838 is for my daily work use. Without a backup phone, I am not ready to try the concept. The project is not dead yet, but pending now.

2nd Attempt -- 2ndrec

Savoca also direct me to Safestrap project. As new to Android dev, it is complex for me to port such a job. However, I think it may be possible to run a recovery environment by 2nd-init. Some attemptions were made to port D802 ramdisk of cwm recovery by 2nd-init without success, then I try to study my own "2ndrec" without 2nd-init. I want to make a modified recovery-like program to be injected into Linux init process. Without understanding of displaying things to the framebuffer, I pending this project too.

3rd Attempt -- Early-ADB

As eager to have a fix/recovery environment, I start to focus on adbd (adb daemon). I've found it is much easier to run adbd if I can prepare the basic environment for it and rebuild a custom adbd without unnecessary check. And this the project here.

FURTHER DEVELOPMENTS

You are welcome to provide information for the following subjects

Manually Mount Internal SDCARD

In normal environment (means non-Early-ADB), internal sdcard is a virtual device which is mapped by fuse from "/data/media/0" directory. I don't know if it is a good idea, but you may do the following commands to link it by yourself in adb shell for Early-ADB.

mount -o remount,rw rootfs

rm /sdcard

ln -s /data/media/0 /sdcard

The side effect for the soft link method is all files/dirs created would be root owned. This is different from uid 1023 (media_rw) created by fuse. However, this may not be a problem because in noraml environment fuse oversides all permissions. It means after reboot you can still get full access of all files on fuse mapped virtual sdcard.

Starting from Early-ADB v2, it is not recommanded to link sdcard because SAFE mount makes the internal sdcard path vary.

If you want to do thing such as manually backup "/data" contents to "/sdcard", remember to exclude "/data/media/0" because "/sdcard " is linked to "/data" contents. This is not a problem for "ea-menu" script because it automatically excludes virtual internal sdcard.

Manually Mount External SDCARD

You are welcome to provide information on how to manually mount D838 external sdcard. I know the exact block device of external sdcard is "/dev/block/mmcblk1p1". However, direct mount command does not succeed for my exfat sdcard. If we can mount external sdcard, we can do thing much more for Early-ADB. For example, we can backup and restore "/system" and "/data" partition as custom recovery does. For newer un-rootable stock firmware, you may build custom stock system.img by injecting "su" and "Early-ADB" first, then install it by this project.