Lenovo k860i 移植Android 4.4 cm11進度記錄【下篇--實時更新中】




2014.8.24

k860i的cm11的移植在中斷了近兩三個月之後又開始繼續了,進度記錄的日誌上一篇已經沒什麼寫的了,就完結掉它吧,重新開一篇日誌做下篇好了。最近的戰況是,在scue同學的努力之下,device部分已經可以通過編譯,而且也拿到了官方給的一些源碼(目前有沒有用還不知道,不過可以編譯通過),不過呢,壞消息是scue同學由於工作比較忙,已經全面放棄對k860i的努力。

現在遇到了一些問題,使用官方的源碼,編譯上cm11,刷入之後會出現開機第二屏黑屏的問題,抓了logcat,發現應該是surfaceflinger和hwcomposer部分沒起來,surfaceflinger一直崩潰如此循環,部分logcat如下:

--------- beginning of /dev/log/system
I/auditd ( 1372): Starting up
--------- beginning of /dev/log/main
I/cm ( 1367): ____ _ _ ____ _ _ ____ ____ ____ _ _ _ _ ____ ___
I/cm ( 1383): | \_/ |__| |\ | | | | __ |___ |\ | |\/| | | | \
I/cm ( 1384): |___ | | | | \| |__| |__] |___ | \| | | |__| |__/
I/cm ( 1387): Welcome to Android 4.4.4 / CyanogenMod-11-20140822-UNOFFICIAL-stuttgart  
I/DEBUG ( 1374): debuggerd: Aug 22 2014 21:12:40
I/installd( 1380): installd firing up
I/audit_log( 1372): Previous audit logfile detected, rotating
I/Vold ( 1370): Vold 2.1 (the revenge) firing up
... ...
I/SurfaceFlinger( 1376): SurfaceFlinger is starting
I/SurfaceFlinger( 1376): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
D/libEGL ( 1376): loaded /system/lib/egl/libEGL_mali.so
D/libEGL ( 1376): loaded /system/lib/egl/libGLESv1_CM_mali.so
D/libEGL ( 1376): loaded /system/lib/egl/libGLESv2_mali.so
E/ ( 1376): Device driver API match
E/ ( 1376): Device driver API version: 20
E/ ( 1376): User space API version: 20
E/ ( 1376): mali: REVISION=Linux-r3p2-01rel2 BUILD_DATE=Thu Aug 29 15:22:27 CST 2013
I/gralloc ( 1376): using (fd=16)
I/gralloc ( 1376): id = s3cfb
I/gralloc ( 1376): xres = 720 px
I/gralloc ( 1376): yres = 1280 px
I/gralloc ( 1376): xres_virtual = 720 px
I/gralloc ( 1376): yres_virtual = 2560 px
I/gralloc ( 1376): bpp = 32
I/gralloc ( 1376): r = 16:8
I/gralloc ( 1376): g = 8:8
I/gralloc ( 1376): b = 0:8
I/gralloc ( 1376): width = 114 mm (160.421051 dpi)
I/gralloc ( 1376): height = 203 mm (160.157639 dpi)
I/gralloc ( 1376): refresh rate = 60.38 Hz
I/SurfaceFlinger( 1376): Using composer version 1.0
W/SurfaceFlinger( 1376): getting VSYNC period from fb HAL: 16561775
W/SurfaceFlinger( 1376): no suitable EGLConfig found, trying a simpler query
I/SurfaceFlinger( 1376): EGL informations:
I/SurfaceFlinger( 1376): vendor : Android
I/SurfaceFlinger( 1376): version : 1.4 Android META-EGL
I/SurfaceFlinger( 1376): extensions: EGL_KHR_get_all_proc_addresses EGL_ANDROID_presentation_time EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_reusable_sync EGL_KHR_fence_sync EGL_EXT_create_context_robustness EGL_ANDROID_image_native_buffer EGL_ANDROID_recordable
I/SurfaceFlinger( 1376): Client API: OpenGL_ES
I/SurfaceFlinger( 1376): EGLSurface: 8-8-8-0, config=0x60000012
I/SurfaceFlinger( 1376): OpenGL ES informations:
I/SurfaceFlinger( 1376): vendor : ARM
I/SurfaceFlinger( 1376): renderer : Mali-400 MP
I/SurfaceFlinger( 1376): version : OpenGL ES 2.0
I/SurfaceFlinger( 1376): extensions: GL_EXT_debug_marker GL_OES_texture_npot GL_OES_compressed_ETC1_RGB8_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_depth24 GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_EXT_blend_minmax GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_rgb8_rgba8 GL_EXT_multisampled_render_to_texture GL_EXT_discard_framebuffer GL_OES_get_program_binary GL_ARM_mali_program_binary GL_EXT_shader_texture_lod GL_EXT_robustness GL_OES_depth_texture_cube_map
I/SurfaceFlinger( 1376): GL_MAX_TEXTURE_SIZE = 4096
I/SurfaceFlinger( 1376): GL_MAX_VIEWPORT_DIMS = 4096
E/cutils-trace( 1376): Error opening trace file: No such file or directory (2)
E/[EGL-ERROR]( 1376): mali_surface* __egl_platform_create_surface_from_native_buffer(android_native_buffer_t*, egl_surface*, mali_base_ctx_handle):614: invalid buffer handle given (0x411008f0)
E/[EGL-ERROR]( 1376): void __egl_platform_dequeue_buffer(egl_surface*):1629: Failed to create a surface from native buffer (0x41100860)
E/libEGL ( 1376): eglMakeCurrent:784 error 3003 (EGL_BAD_ALLOC)
E/libEGL ( 1376): call to OpenGL ES API with no current context (logged once per thread)
D/SurfaceFlinger( 1376): Screen acquired, type=0 flinger=0x414c7450
F/libc ( 1376): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 1376 (surfaceflinger)
D/libEGL ( 1459): loaded /system/lib/egl/libEGL_mali.so
D/libEGL ( 1459): loaded /system/lib/egl/libGLESv1_CM_mali.so
D/libEGL ( 1459): loaded /system/lib/egl/libGLESv2_mali.so
E/ ( 1459): Device driver API match
E/ ( 1459): Device driver API version: 20
E/ ( 1459): User space API version: 20
E/ ( 1459): mali: REVISION=Linux-r3p2-01rel2 BUILD_DATE=Thu Aug 29 15:22:27 CST 2013
E/cutils-trace( 1459): Error opening trace file: No such file or directory (2)
E/[EGL-ERROR]( 1459): mali_surface* __egl_platform_create_surface_from_native_buffer(android_native_buffer_t*, egl_surface*, mali_base_ctx_handle):614: invalid buffer handle given (0x40092360)
E/[EGL-ERROR]( 1459): void __egl_platform_dequeue_buffer(egl_surface*):1629: Failed to create a surface from native buffer (0x40092230)
E/libEGL ( 1459): eglMakeCurrent:784 error 3003 (EGL_BAD_ALLOC)
I/DEBUG ( 1374): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 1374): Build fingerprint: 'Lenovo/cm_stuttgart/stuttgart:4.4.4/KTU84Q/149b325933:userdebug/test-keys'
I/DEBUG ( 1374): Revision: '0'
I/DEBUG ( 1374): pid: 1376, tid: 1376, name: surfaceflinger >>> /system/bin/surfaceflinger <<<
I/DEBUG ( 1374): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000


我感覺如果把這個問題給解決了的話,離cm11進桌面應該就不遠了。

當然最近也有一些好消息。

偶然間從cm的github的smdk4412內核的commit記錄裏面找到了不少的好東西,比如內核開啓selinux(對於4.3、4.4很重要),又比如解決使用arm-linux-gcc 4.7版編譯這個內核出現的一堆inline函數定義的編譯錯誤的解決方法等等,開源的力量就是強大啊,這個內核的commit次數居然高達25萬多次。。。。地址是https://github.com/CyanogenMod/android_kernel_samsung_smdk4412/tree/stable/cm-11.0

之前由於使用arm-linux-gcc 4.7編譯內核會出現inline函數定義的錯誤,所以導致編譯cm11的時候只能使用預編譯的內核,因爲cm11編譯過程中會使用4.7版的arm-linux-gcc,而聯想給的內核源碼之前只有使用4.6版的arm-linux-gcc纔不會有問題。cm官方是推薦使用內核源碼跟cm11的源碼樹一起編譯,官方的解釋是在這裏 http://wiki.cyanogenmod.org/w/Doc:_integrated_kernel_building 。解決了4.7版的toolchain編譯內核的錯誤之後,就可以讓內核源碼跟cm11一起編譯了。相關的commit在這裏https://github.com/CyanogenMod/android_kernel_samsung_smdk4412/commit/49c33dab8b7a57780affea28db976ccab8dc345b, 需要注意的是文件名不完全一致,drivers/media/video/exynos/fimc-lite/fimc-lite-core.c和fimc-lite.core.h是對的,刪掉inline定義的地方也是一樣的,但是在這個commit裏面提到的另外兩個文件,drivers/video/samsung_extdisp/s3cfb_extdsp.h 和s3cfb_extdsp_main.c,文件名有差異,在聯想的內核源碼裏面,應該是drivers/video/samsung/s3cfb.h和s3cfb_main.c,修改的行數略有差異,但實際上也都是去掉inline的定義。


另外一個是selinux的問題了,相關的commit在這裏 https://github.com/CyanogenMod/android_kernel_samsung_smdk4412/commit/84c11baf1cd2873665c9bd51f720ee3d83faefa2 ,這個commit裏面包含了多個機器的內核defconfig,實際上只需要對照它修改ki的官方內核源碼的kernel/arch/arm/configs/stuttgart_android_defconfig這個文件,對照着上面的commit裏面的某個內核的defconfig依樣畫葫蘆添加修改就可以了。其實還可以在內核根目錄用make menuconfig或make nconfig自己手工開啓selinux的支持,不過既然有現成的可以直接用,那也大可不必自己再修改了。


還是得學習一下git的使用啊,要把這些東西都上傳到github上面去,不然管理這些東西實在是太麻煩了。







發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章