Adaptations/libhybris/Install SailfishOS for gemini

Hardware Support

 * }

Status

 * 21th Jul 2017: most sensors work, and also OTA :)
 * 16th Jul 2017: audio/video playback works, camera partially works, preview and capture work, video record not.
 * 26th May 2017: tried krnlyng's hwc workround, now lipstick working happily :), many thanks to krnlyng!
 * 16th February 2017: wifi works.
 * 14th February 2017: Unstable, not ready for use :)

Downloads
Last image you can get here https://www.androidfilehost.com/?fid=8889791610682945367

Steps to install
!!!! BACKUP YOUR FILES FIRST!!!!


 * unlock bootloader, please follow http://www.miui.com/unlock

fastboot flash recovery twrp-3.0.2-3-gemini.img
 * flash twrp recovery & format data partition (press and hold Volume down and Power key, boot to bootloader)

cm-13.0-20161220-SNAPSHOT-ZNH5YAO3XM-gemini.zip
 * flash cm13.0 zip with twrp (press and hold Volume up and Power key, boot to recovery)

sailfishos-gemini-release-2.1.0.11-alpha5.zip
 * flash sailfishos zip with twrp


 * reboot!

Build image by yourself

 * Refer to https://sailfishos.org/hadk and download the porting guide PDF
 * Replace "Creating Repositories for a New Device" section with this local manifest https://raw.githubusercontent.com/zhxt/local_manifests/hybris-13.0/gemini.xml

Known Issues
1. lipstic crash sometimes.[fixed with krnlyng's hybris patch].

dmesg:

[ +19.213579] __create_fence: fb0_release: get_unused_fd_flags failed error:0xffffffe8 [ +0.000018] __handle_buffer_fences: unable to retrieve release fence [ +0.044521] binder: send failed reply for transaction 6048, target dead

2. The working version of libdsyscalls.so is borrowed from ghosalmartin. :)

[fixed by: zhxt, revert the thread_local stuff, and add LOCAL_CLANG := false to libdsyscalls.so in Android.mk ]