您的位置:首页 > 移动开发 > Android开发

Lenovo k860i 移植Android 4.4 cm11进度记录【下篇--实时更新中】

2016-02-06 13:37 866 查看
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上面去,不然管理这些东西实在是太麻烦了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: