[Miscellaneous Android Development] HypoTurtle:
TWRP For Lollipop

[MENTION=5186178]carliv[/MENTION] [MENTION=4478781]yuweng[/MENTION] [MENTION=5480061]Santhosh M[/MENTION]

Just summerising the state of TWRP/PhilZ recovery.

Now that we have touch/TWRP on KK; [MENTION=3924647]bigrammy[/MENTION] and I have tried to get it to boot correctly while running L; as it's needed to deal with the forceencrypted data.

Linked is a copy of stock recovery, boot and CWM-L.img (KK CWM recovery with L kernel).

CWM-L.img boots fine but as it can't handle encryption it can't use/backup /data and /data/media/.

Any iteration of TWRP/PhilZ with the L kernel results in a recovery bootloop, while with KK(blaster) recovery it results in a stalled boot to recovery followed by a normal system boot.

I was able to get adb with PhilZ: the devices/interrupts are the same as non-touch KK afaik:

CPU0
29: 0 GIC arch_timer
30: 1180 GIC arch_timer
96: 0 GIC mtk_cpuxgpt0
97: 0 GIC mtk_cpuxgpt1
98: 0 GIC mtk_cpuxgpt2
99: 0 GIC mtk_cpuxgpt3
100: 0 GIC mtk_cpuxgpt4
101: 0 GIC mtk_cpuxgpt5
102: 0 GIC mtk_cpuxgpt6
103: 0 GIC mtk_cpuxgpt7
104: 191 GIC musb-hdrc.0.auto
110: 0 GIC mtk-thermal
111: 360 GIC mtk-msdc
112: 2 GIC mtk-msdc
116: 43 GIC 11007000.I2C0
117: 73 GIC 11008000.I2C1
118: 0 GIC 11009000.I2C2
123: 1 GIC
150: 0 GIC 1100a000.SPI1
157: 4 GIC ptp
160: 0 GIC mtk_watchdog
166: 0 GIC mt_emi_mpu, devapc
171: 0 GIC CCIF0_AP
174: 0 GIC Afe_ISR_Handle
175: 636 GIC mtk_cmdq, CQDMA
177: 0 GIC m4u
179: 0 GIC m4u
182: 0 GIC gcpu
184: 0 GIC mt-gpt
193: 0 GIC pmic_wrap
194: 0 GIC mtk-kpd
195: 0 GIC SPM
196: 0 GIC SPM
197: 0 GIC SPM
198: 0 GIC SPM
199: 0 GIC SPM
200: 0 GIC SPM
201: 0 GIC SPM
202: 0 GIC SPM
206: 0 GIC MD32 IPC_MD2HOST
209: 0 GIC DISPSYS
216: 637 GIC DISPSYS
217: 0 GIC DISPSYS
218: 1866 GIC DISPSYS
219: 0 GIC DISPSYS
220: 0 GIC DISPSYS
223: 15 GIC DISPSYS
227: 1 GIC DISPSYS
238: 0 GIC Vcodec
240: 0 GIC jpeg_enc_driver
243: 0 GIC jpeg_dec_driver
244: 0 GIC Vcodec
247: 0 GIC MJC
251: 0 GIC ISP
254: 0 GIC ISP
255: 0 GIC ISP
256: 0 GIC camera-fdvt
257: 1 GIC 13040000.MALI
258: 0 GIC 13040000.MALI
259: 0 GIC 13040000.MALI
264: 0 GIC MD_WDT
265: 0 GIC CLDMA_AP
268: 0 GIC BTCVSD_ISR_Handle
281: 0 GIC ATF_irq
289: 0 mt-eint ACCDET-eint
312: 0 mt-eint mt6325-eint
351: 0 mt-eint USB_IDDIG
IPI0: 530 1383 185 613 Rescheduling interrupts
IPI1: 4 1 4 3 Function call interrupts
IPI2: 2 42 6 0 Single function call interrupts
IPI3: 0 0 0 0 CPU stop interrupts
Err: 0

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="hwmdata"
P: Phys=
S: Sysfs=/devices/virtual/input/input0
U: Uniq=
H: Handlers=event0 gpufreq_ib
B: PROP=0
B: EV=5
B: REL=2

I: Bus=0019 Vendor=0000 Product=0000 Version=0000
N: Name="ACCDET"
P: Phys=
S: Sysfs=/devices/virtual/input/input1
U: Uniq=
H: Handlers=event1 gpufreq_ib
B: PROP=0
B: EV=3
B: KEY=80 0 78 0 40c0000 0 0 0

I: Bus=0019 Vendor=2454 Product=6500 Version=0010
N: Name="mtk-kpd"
P: Phys=
S: Sysfs=/devices/bus.2/10010000.KP/input/input2
U: Uniq=
H: Handlers=event2 gpufreq_ib
B: PROP=0
B: EV=3
B: KEY=80 180000 0 40000800 1c0840 0 0 0

I: Bus=0006 Vendor=0000 Product=0000 Version=0000
N: Name="MHL Remote Control"
P: Phys=
S: Sysfs=/devices/virtual/input/input3
U: Uniq=
H: Handlers=event3 gpufreq_ib
B: PROP=0
B: EV=3
B: KEY=108 0 0 0 0 218200 12a 40000801 801680 0 f8100000 10000ffc

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="m_alsps_input"
P: Phys=
S: Sysfs=/devices/virtual/input/input4
U: Uniq=
H: Handlers=event4 gpufreq_ib
B: PROP=0
B: EV=d
B: REL=6
B: ABS=101

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="m_acc_input"
P: Phys=
S: Sysfs=/devices/virtual/input/input5
U: Uniq=
H: Handlers=event5 gpufreq_ib
B: PROP=0
B: EV=9
B: ABS=107

No movement from I2C upon touch

And have a TWRP last.log

__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
Starting TWRP 2.8.4.0 on Fri Mar 13 16:07:56 2015
(pid 153)
I:=> product model: 'p6000'
I:=> using device id: 'p6000'
RECOVERY_SDCARD_ON_DATA := true
I:Lun file '/sys/devices/virtual/android_usb/android0/f_mass_storage/lun0/file' does not exist, USB storage mode disabled
TW_INCLUDE_CRYPTO := true
I:TW_BRIGHTNESS_PATH := /sys/class/leds/lcd-backlight/brightness
I:Found brightness file at '/sys/class/leds/lcd-backlight/brightness'
I:TWFunc::Set_Brightness: Setting brightness control to 255
Starting the UI...Pixel format: 720x1280 @ 32bpp
Pixel format: RGBA_8888
Not using qualcomm overlay, 'mtkfb'
framebuffer: fd 3 (720 x 1280)
=> Linking mtab
=> Processing recovery.fstab
I:Processing '/boot'
I:Processing '/logo'
I:Processing '/nvram'
I:Processing '/recovery'
I:Processing '/lk'
I:Processing '/system'
I:Processing '/cache'
I:Processing '/data'
I:Setting up '/data' as data/media emulated storage.
I:Created '/sdcard' folder.
I:Can't probe device /dev/block/mmcblk0p19
I:Unable to mount '/data'
I:Actual block device: '/dev/block/mmcblk0p19', current file system: 'ext4'
I:Can't probe device /dev/block/mmcblk0p19
I:Unable to mount '/data'
I:Actual block device: '/dev/block/mmcblk0p19', current file system: 'ext4'
get_crypt_ftr_info crypto key location: 'footer'
Bad magic for real block device /dev/block/mmcblk0p19
E:Could not mount /data and unable to find crypto footer.
I:Can't probe device /dev/block/mmcblk0p19
E:Unable to mount '/data'
I:Actual block device: '/dev/block/mmcblk0p19', current file system: 'ext4'
E:Unable to recreate /data/media folder.
I:Processing '/custom'
I:Created '/custom' folder.
I:Processing '/external_sd'
I:Created '/external_sd' folder.
I:Backup folder set to '/data/media/TWRP/BACKUPS/p6000'
I:Settings storage is '/data/media'
Updating partition details...
I:Can't probe device /dev/block/mmcblk0p19
E:Unable to mount '/data'
I:Actual block device: '/dev/block/mmcblk0p19', current file system: 'ext4'
...done
I:Can't probe device /dev/block/mmcblk0p19
I:Unable to mount '/data'
I:Actual block device: '/dev/block/mmcblk0p19', current file system: 'ext4'
E:Unable to mount storage.
I:Unmounting main partitions...

Partition Logs:
/boot | /dev/block/mmcblk0p7 | Size: 16MB
Flags: Can_Be_Backed_Up IsPresent Can_Flash_Img
Primary_Block_Device: /dev/block/mmcblk0p7
Display_Name: Boot
Storage_Name: Boot
Backup_Path: /boot
Backup_Name: boot
Backup_Display_Name: Boot
Storage_Path: /boot
Current_File_System: emmc
Fstab_File_System: emmc
Backup_Method: dd

/logo | /dev/block/mmcblk0p11 | Size: 8MB
Flags: Can_Be_Backed_Up IsPresent
Primary_Block_Device: /dev/block/mmcblk0p11
Display_Name: Logo
Storage_Name: Logo
Backup_Path: /logo
Backup_Name: logo
Backup_Display_Name: Logo
Storage_Path: /logo
Current_File_System: emmc
Fstab_File_System: emmc
Backup_Method: dd

/nvram | /dev/block/mmcblk0p2 | Size: 5MB
Flags: Can_Be_Backed_Up IsPresent
Primary_Block_Device: /dev/block/mmcblk0p2
Display_Name: Nvram
Storage_Name: Nvram
Backup_Path: /nvram
Backup_Name: nvram
Backup_Display_Name: Nvram
Storage_Path: /nvram
Current_File_System: emmc
Fstab_File_System: emmc
Backup_Method: dd

/recovery | /dev/block/mmcblk0p8 | Size: 16MB
Flags: Can_Be_Backed_Up IsPresent Can_Flash_Img
Primary_Block_Device: /dev/block/mmcblk0p8
Display_Name: Recovery
Storage_Name: Recovery
Backup_Path: /recovery
Backup_Name: recovery
Backup_Display_Name: Recovery
Storage_Path: /recovery
Current_File_System: emmc
Fstab_File_System: emmc
Backup_Method: dd

/lk | /dev/block/mmcblk0p6 | Size: 0MB
Flags: Can_Be_Backed_Up IsPresent Can_Flash_Img
Primary_Block_Device: /dev/block/mmcblk0p6
Display_Name: Uboot
Storage_Name: Uboot
Backup_Path: /lk
Backup_Name: lk
Backup_Display_Name: Uboot
Storage_Path: /lk
Current_File_System: emmc
Fstab_File_System: emmc
Backup_Method: dd

/system | /dev/block/mmcblk0p17 | Size: 1092MB Used: 924MB Free: 167MB Backup Size: 924MB
Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_Available_in_GUI IsPresent
Primary_Block_Device: /dev/block/mmcblk0p17
Display_Name: System
Storage_Name: System
Backup_Path: /system
Backup_Name: system
Backup_Display_Name: System
Storage_Path: /system
Current_File_System: ext4
Fstab_File_System: ext4
Backup_Method: files

/cache | /dev/block/mmcblk0p18 | Size: 410MB Used: 0MB Free: 409MB Backup Size: 0MB
Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_During_Factory_Reset Wipe_Available_in_GUI IsPresent
Primary_Block_Device: /dev/block/mmcblk0p18
Display_Name: Cache
Storage_Name: Cache
Backup_Path: /cache
Backup_Name: cache
Backup_Display_Name: Cache
Storage_Path: /cache
Current_File_System: ext4
Fstab_File_System: ext4
Backup_Method: files

/data | /dev/block/mmcblk0p19 | Size: 0MB Used: 0MB Free: 0MB Backup Size: 0MB
Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_During_Factory_Reset Wipe_Available_in_GUI IsPresent Can_Be_Encrypted Has_Data_Media Can_Encrypt_Backup Use_Userdata_Encryption Is_Storage Is_Settings_Storage
Symlink_Path: /data/media
Symlink_Mount_Point: /sdcard
Primary_Block_Device: /dev/block/mmcblk0p19
Display_Name: Data
Storage_Name: Data
Backup_Path: /data
Backup_Name: data
Backup_Display_Name: Data
Storage_Path: /data/media
Current_File_System: ext4
Fstab_File_System: ext4
Backup_Method: files
MTP_Storage_ID: 65537

/custom | /dev/block/mmcblk0p12 | Size: 290MB Used: 38MB Free: 252MB Backup Size: 38MB
Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_Available_in_GUI IsPresent
Primary_Block_Device: /dev/block/mmcblk0p12
Display_Name: Custom Partition
Storage_Name: Custom Partition
Backup_Path: /custom
Backup_Name: custom
Backup_Display_Name: Custom Partition
Storage_Path: /custom
Current_File_System: ext4
Fstab_File_System: ext4
Backup_Method: files

/external_sd | /dev/block/mmcblk1p1 | Size: 14966MB Used: 10847MB Free: 4119MB Backup Size: 10847MB
Flags: Can_Be_Mounted Can_Be_Wiped Wipe_Available_in_GUI Removable IsPresent Is_Storage
Primary_Block_Device: /dev/block/mmcblk1p1
Display_Name: External SDcard
Storage_Name: External SDcard
Backup_Path: /external_sd
Backup_Name: external_sd
Backup_Display_Name: External SDcard
Storage_Path: /external_sd
Current_File_System: vfat
Fstab_File_System: vfat
Backup_Method: files
MTP_Storage_ID: 65538

I:Loading package: TWRP (/script/ui.xml)
I:Load XML directly
I:Can't probe device /dev/block/mmcblk0p19
I:Unable to mount '/data'
I:Actual block device: '/dev/block/mmcblk0p19', current file system: 'ext4'
I:Can't probe device /dev/block/mmcblk0p19
I:Unable to mount '/data'
I:Actual block device: '/dev/block/mmcblk0p19', current file system: 'ext4'
I:Can't probe device /dev/block/mmcblk0p19
I:Unable to mount '/data'
I:Actual block device: '/dev/block/mmcblk0p19', current file system: 'ext4'
I:Can't probe device /dev/block/mmcblk0p19
I:Unable to mount '/data'
I:Actual block device: '/dev/block/mmcblk0p19', current file system: 'ext4'
I:Can't probe device /dev/block/mmcblk0p19
I:Unable to mount '/data'
I:Actual block device: '/dev/block/mmcblk0p19', current file system: 'ext4'
I:Can't probe device /dev/block/mmcblk0p19
I:Unable to mount '/data'
I:Actual block device: '/dev/block/mmcblk0p19', current file system: 'ext4'
I:Can't probe device /dev/block/mmcblk0p19
I:Unable to mount '/data'
I:Actual block device: '/dev/block/mmcblk0p19', current file system: 'ext4'
E:Unable to mount /data/media during GUI startup.
I:Loading package: TWRP (/twres/ui.xml)
I:Load XML directly
I:Loading resources...
open_png /twres/images/menu-button.png
open_png /twres/images/file.png
open_png /twres/images/folder.png
open_png /twres/images/slideout.png
open_png /twres/images/indeterminate001.png
open_png /twres/images/indeterminate002.png
open_png /twres/images/indeterminate003.png
open_png /twres/images/indeterminate004.png
open_png /twres/images/indeterminate005.png
open_png /twres/images/indeterminate006.png
open_png /twres/images/indeterminate007.png
open_png /twres/images/progress_empty.png
open_png /twres/images/progress_fill.png
open_png /twres/images/checkbox_empty.png
open_png /twres/images/checkbox_checked.png
open_png /twres/images/radio_empty.png
open_png /twres/images/radio_selected.png
open_png /twres/images/medium-button.png
open_png /twres/images/sort-button.png
open_png /twres/images/minus-button.png
open_png /twres/images/plus-button.png
open_png /twres/images/home-icon.png
open_png /twres/images/back-icon.png
open_png /twres/images/slider.png
open_png /twres/images/slider-used.png
open_png /twres/images/slider-touch.png
open_png /twres/images/unlock.png
open_png /twres/images/keyboard1.png
open_png /twres/images/keyboard2.png
open_png /twres/images/keyboard3.png
open_png /twres/images/keyboard4.png
open_png /twres/images/cursor.png
I:Loading variables...
I:Loading mouse cursor...
I:Loading pages...
I:PageSet::CheckInclude loading filename: '/twres/portrait.xml'
I:Loading included resources...
I:Loading included variables...
I:Loading mouse cursor...
I:Loading included pages...
I:Loading page main
I:Loading page main2
I:Loading page install
I:Loading page flash_confirm
I:Loading page flash_zip
I:Loading page flash_done
I:Loading page install_image
I:Loading page flashimage_confirm
I:Loading page clear_vars
I:Loading page confirm_action
I:Loading page action_page
I:Loading page singleaction_page
I:Loading page action_complete
I:Loading page filecheck
I:Loading page rebootcheck
I:Loading page wipe
I:Loading page advancedwipe
I:Loading page formatdata
I:Loading page formatdata_confirm
I:Loading page checkpartitionlist
I:Loading page partitionoptions
I:Loading page refreshfilesystem
I:Loading page selectfilesystem
I:Loading page backup
I:Loading page backupname1
I:Loading page backupname2
I:Loading page backupencryption
I:Loading page backupencryption2
I:Loading page checkbackuppassword
I:Loading page backup_run
I:Loading page restore
I:Unable to open '/data/media/TWRP/BACKUPS/p6000'
I:Loading page restore_read
I:Loading page restore_decrypt
I:Loading page try_restore_decrypt
I:Loading page restore_select
I:Loading page renamebackup
I:Loading page restore_run
I:Loading page selectstorage
I:Loading page mount
I:Loading page usb_mount
I:Loading page usb_umount
I:Loading page reboot
I:Loading page settings
I:Loading page timezone
I:Loading page screen
I:Loading page Vibrate
I:Loading page advanced
I:Loading page partsdcard
I:Loading page htcdumlock
I:Loading page lock
I:Loading page filemanagerlist
I:Loading page filemanageroptions
I:Loading page choosedestinationfolder
I:Loading page filemanagerrenamefile
I:Loading page filemanagerrenamefolder
I:Loading page filemanagerchmod
I:Loading page filemanagerconfirm
I:Loading page filemanageracction
I:Loading page decrypt
I:Loading page trydecrypt
I:Loading page terminalfolder
I:Loading page terminalcommand
I:Loading page sideload
I:Loading page fixperms
I:Loading page installsu
I:Set page: 'clear_vars'
I:Set page: 'main2'
I:Switching packages (TWRP)
SELinux contexts loaded from /file_contexts
Full SELinux support is present.
E:Cannot load volume /misc!
E:Cannot load volume /misc!
Startup Commands:
ro.cm.device=p6000
ro.cm.display.version=11-20150207-UNOFFICIAL-p6000
ro.cm.version=11-20150207-UNOFFICIAL-p6000
ro.cm.releasetype=UNOFFICIAL
ro.adb.qemud=1
ro.adb.secure=0
ro.cip.partition.support=no
ro.com.google.clientidbase=android-google
ro.com.android.dateformat=MM-dd-yyyy
ro.com.android.dataroaming=false
ro.com.android.wifi-watchlist=GoogleGuest
ro.ril.hsxpa=1
ro.ril.gprsclass=10
ro.url.legal=http://www.google.com/intl/%s/mobile/android/basic/phone-legal.html
ro.url.legal.android_privacy=http://www.google.com/intl/%s/mobile/android/basic/privacy.html
ro.boot.emmc=0
ro.boot.hardware=mt6752
ro.boot.serialno=0123456789ABCDEF
ro.boot.bootreason=rtc
ro.emmc=0
ro.fota.oem=new-bund6732_KK
ro.fota.type=phone
ro.fota.device=k01q_e
ro.fota.version=eng.jenkins.1419698357
ro.fota.platform=MTK6732_KK
ro.twrp.boot=1
ro.twrp.version=2.8.4.0
ro.wifi.channels=
ro.allow.mock.location=1
ro.board.platform=mt6752
ro.build.id=KTU84Q
ro.build.date=Sat Feb 7 21:47:11 EET 2015
ro.build.date.utc=0
ro.build.host=max
ro.build.tags=test-keys
ro.build.type=eng
ro.build.user=carliv
ro.build.display.id=cm_p6000-eng 4.4.4 KTU84Q 00c6244ff1 test-keys
ro.build.product=p6000
ro.build.selinux=1
ro.build.version.sdk=19
ro.build.version.release=4.4.4
ro.build.version.codename=REL
ro.build.version.incremental=00c6244ff1
ro.build.description=cm_p6000-eng 4.4.4 KTU84Q 00c6244ff1 test-keys
ro.build.fingerprint=alps/cm_p6000/p6000:4.4.4/KTU84Q/00c6244ff1:eng/test-keys
ro.build.characteristics=default
ro.mount.fs=EXT4
ro.config.ringtone=Orion.ogg
ro.config.alarm_alert=Hassium.ogg
ro.config.notification_sound=Argon.ogg
ro.dalvik.vm.native.bridge=0
ro.kernel.android.checkjni=1
ro.secure=0
ro.zygote=zygote32
ro.carrier=unknown
ro.cmlegal.url=https://www.cyanogenmod.org/docs/privacy
ro.persist.partition.support=no
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.cpu.abilist=armeabi-v7a,armeabi
ro.product.cpu.abilist32=armeabi-v7a,armeabi
ro.product.cpu.abilist64=
ro.product.name=cm_p6000
ro.product.board=k01q_e
ro.product.brand=alps
ro.product.model=p6000
ro.product.device=p6000
ro.product.locale.region=US
ro.product.locale.language=en
ro.product.manufacturer=ELEPHONE
ro.baseband=unknown
ro.bootmode=unknown
ro.hardware=mt6752
ro.revision=0
ro.serialno=0123456789ABCDEF
ro.bootloader=unknown
ro.debuggable=1
ro.modversion=11-20150207-UNOFFICIAL-p6000
ro.rommanager.developerid=cyanogenmod
ro.factorytest=0
ro.setupwizard.enterprise_mode=1
net.bt.name=Android
net.change=net.bt.name
init.svc.adbd=running
init.svc.healthd=restarting
init.svc.ueventd=running
init.svc.recovery=running
init.svc.set_permissive=stopped
twrp.crash_counter=0
dalvik.vm.dex2oat-Xms=64m
dalvik.vm.dex2oat-Xmx=512m
dalvik.vm.stack-trace-file=/data/anr/traces.txt
dalvik.vm.image-dex2oat-Xms=64m
dalvik.vm.image-dex2oat-Xmx=64m
persist.mtk.aee.aed=on
persist.sys.dun.override=0
persist.sys.usb.config=mtp,adb
persist.sys.dalvik.vm.lib=libdvm.so
persist.sys.dalvik.multithread=false
persist.sys.root_access=1
persist.sys.recovery_update=false
persist.service.acm.enable=0
service.adb.root=1
keyguard.no_require_sim=true

I know the bootloop is possibly an encrypted data issue; but I'd rather not wipe to confirm for the time being; why the KK(Blaster) kernel (i.e. touch kernel) won't boot on the L formatted system is another issue. kernel compilation/compression ??