解决rk3288启动SurfaceFlinger 初始化失败问题

RK3288设备在进行源码编译后出现启动失败问题,表现为surfaceflinger崩溃。通过对比正常启动与异常启动的Kernel日志,发现mali驱动加载时的vermagic不匹配,最终通过调整编译配置解决了该问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最近编译rk3288源码遇到一个奇怪的问题,正常编译使用的Android源码。如果做一些改动之后。再烧录启动失败很是苦恼,主要报下面错误
kernel 失败日志

[    4.088148] EXT4-fs (mmcblk0p12): recovery complete
[    4.088569] EXT4-fs (mmcblk0p12): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,errors=remount-ro
[    4.088640] fs_mgr: check_fs(): mount(/dev/block/platform/ff0f0000.rksdmmc/by-name/userdata,/data,ext4)=0
[    4.089558] fs_mgr: Running /sbin/e2fsck on /dev/block/platform/ff0f0000.rksdmmc/by-name/userdata
[    4.094685] e2fsck: e2fsck 1.42.9 (28-Dec-2013)
[    4.094716] e2fsck: /dev/block/platform/ff0f0000.rksdmmc/by-name/userdata: clean, 87/65536 files, 8892/262144 blocks
[    4.099557] EXT4-fs (mmcblk0p12): mounted filesystem with ordered data mode. Opts: noauto_da_alloc,discard,errors=panic
[    4.099610] fs_mgr: __mount(source=/dev/block/platform/ff0f0000.rksdmmc/by-name/userdata,target=/data,type=ext4)=0
[    4.099624] fs_mgr: mount_with_alternatives(): Mounted /dev/block/platform/ff0f0000.rksdmmc/by-name/userdata on /data with fs_type=ext4 instead of f2fs
[    4.114656] mali_kbase: version magic '3.10.0 SMP preempt mod_unload ARMv7 p2v8 ' should be '3.10.0+ SMP preempt mod_unload ARMv7 p2v8 '
[    4.115626] rk29_ipp: version magic '3.0.8+ SMP preempt mod_unload ARMv7 ' should be '3.10.0+ SMP preempt mod_unload ARMv7 p2v8 '
[    4.116342] rk29_ipp: version magic '3.0.36+ SMP preempt mod_unload ARMv7 ' should be '3.10.0+ SMP preempt mod_unload ARMv7 p2v8 '
[    4.117034] rk29_ipp: version magic '3.0.101+ SMP preempt mod_unload ARMv7 ' should be '3.10.0+ SMP preempt mod_unload ARMv7 p2v8 '
[    4.117938] zram0: detected capacity change from 0 to 533413888
[    4.179195] Adding 520908k swap on /dev/block/zram0.  Priority:-1 extents:1 across:520908k SS
[    4.212235] EXT4-fs (mmcblk0p12): Unrecognized mount option "background_gc=on" or missing value
[    4.218352] bat_cap: oldcap path is /sys/devices/ff100000.adc
[    4.218391] bat_cap: oldcap_path no exist
[    4.218517] binder: 147:147 transaction failed 29189, size 0-0
[    4.218892] init: Warning!  Service displayd needs a SELinux domain defined; please fix!

正常开机kernel日志

[    4.053321] EXT4-fs (mmcblk0p12): recovery complete
[    4.053741] EXT4-fs (mmcblk0p12): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,errors=remount-ro
[    4.053809] fs_mgr: check_fs(): mount(/dev/block/platform/ff0f0000.rksdmmc/by-name/userdata,/data,ext4)=0
[    4.054772] fs_mgr: Running /sbin/e2fsck on /dev/block/platform/ff0f0000.rksdmmc/by-name/userdata
[    4.059909] e2fsck: e2fsck 1.42.9 (28-Dec-2013)
[    4.059940] e2fsck: /dev/block/platform/ff0f0000.rksdmmc/by-name/userdata: clean, 512/65536 files, 24112/262144 blocks
[    4.064803] EXT4-fs (mmcblk0p12): mounted filesystem with ordered data mode. Opts: noauto_da_alloc,discard,errors=panic
[    4.064859] fs_mgr: __mount(source=/dev/block/platform/ff0f0000.rksdmmc/by-name/userdata,target=/data,type=ext4)=0
[    4.064873] fs_mgr: mount_with_alternatives(): Mounted /dev/block/platform/ff0f0000.rksdmmc/by-name/userdata on /data with fs_type=ext4 instead of f2fs
[    4.081348] arm_release_ver of this mali_ko is 'r6p0-02rel0', rk_ko_ver is '13', built at '09:15:10', on 'Oct 22 2015'.
[    4.081418] mali ffa30000.gpu: Continuing without Mali clock control
[    4.081451] mali pd enabled
[    4.081458] clk enabled
[    4.082773] MALI_DVFS_STEP = 5, div_dvfs = 7 
[    4.082782] mali_dvfs_infotbl[0].clock=99000,min_threshold=0,max_threshold=70
[    4.082789] mali_dvfs_infotbl[1].clock=198000,min_threshold=65,max_threshold=77
[    4.082795] mali_dvfs_infotbl[2].clock=297000,min_threshold=75,max_threshold=84
[    4.082802] mali_dvfs_infotbl[3].clock=417000,min_threshold=82,max_threshold=91
[    4.082808] mali_dvfs_infotbl[4].clock=480000,min_threshold=94,max_threshold=100
[    4.082893] gpufreq_input_connect
[    4.082903] turn on mali power
[    4.082910] kbase_platform_rk_init,register_reboot_notifier
[    4.082949] hrtimer: interrupt took 10791 ns
[    4.083031] mali ffa30000.gpu: GPU identified as 0x0750 r0p0 status 1
[    4.085077] mali ffa30000.gpu: Probed as mali0
[    4.086733] rk29_ipp: version magic '3.0.8+ SMP preempt mod_unload ARMv7 ' should be '3.10.0 SMP preempt mod_unload ARMv7 p2v8 '
[    4.087457] rk29_ipp: version magic '3.0.36+ SMP preempt mod_unload ARMv7 ' should be '3.10.0 SMP preempt mod_unload ARMv7 p2v8 '
[    4.088164] rk29_ipp: version magic '3.0.101+ SMP preempt mod_unload ARMv7 ' should be '3.10.0 SMP preempt mod_unload ARMv7 p2v8 '
[    4.089051] zram0: detected capacity change from 0 to 533413888
[    4.150924] Adding 520908k swap on /dev/block/zram0.  Priority:-1 extents:1 across:520908k SS
[    4.181575] EXT4-fs (mmcblk0p12): Unrecognized mount option "background_gc=on" or missing value
[    4.188992] bat_cap: oldcap path is /sys/devices/ff100000.adc
[    4.189032] bat_cap: oldcap_path no exist
[    4.189161] binder: 152:152 transaction failed 29189, size 0-0

Android logcat 日志

I/AudioFlinger(  157): Using default 3000 mSec as standby time.

I/ServiceManager(  157): Waiting for service batterystats...

D/MDnsDS  (  153): MDnsSdListener::Hander starting up

D/MDnsDS  (  153): MDnsSdListener starting to monitor

D/MDnsDS  (  153): Going to poll with pollCount 1

D/libEGL  (  151): loaded /vendor/lib/egl/libGLES_mali.so

I/mali_so (  151): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 780; [Func] : base_context_deal_with_version_affairs_rk_ext;

I/mali_so (  151): arm_release_ver of this mali_so is 'r6p0-02rel0', rk_so_ver is '11@0', built at '17:59:04', on 'Aug 12 2015'.

E/mali_so (  151): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 834; [Func] : get_ver_info_from_mali_ko_rk_ext;

E/mali_so (  151): Function call returned error : err = 3.

E/mali_so (  151): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 782; [Func] : base_context_deal_with_version_affairs_rk_ext;

E/mali_so (  151): Function call returned error : err = 3.

E/mali_so (  151): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_context.c; [Line] : 236; [Func] : basep_context_init;

E/mali_so (  151): fail to deal with version affairs of rk_ext. err : 3.

E/mali    (  151): ERROR: The DDK is not compatible with any of the Mali GPUs on the system.

E/mali    (  151): The DDK was built for 0x750 r0p0 status range [1..1], but none of the GPUs matched:

I/mali_so (  151): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 780; [Func] : base_context_deal_with_version_affairs_rk_ext;

I/mali_so (  151): arm_release_ver of this mali_so is 'r6p0-02rel0', rk_so_ver is '11@0', built at '17:59:04', on 'Aug 12 2015'.

E/mali_so (  151): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 834; [Func] : get_ver_info_from_mali_ko_rk_ext;

E/mali_so (  151): Function call returned error : err = 3.

E/mali_so (  151): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 782; [Func] : base_context_deal_with_version_affairs_rk_ext;

E/mali_so (  151): Function call returned error : err = 3.

E/mali_so (  151): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_context.c; [Line] : 236; [Func] : basep_context_init;

E/mali_so (  151): fail to deal with version affairs of rk_ext. err : 3.

W/libEGL  (  151): eglInitialize(0xb76c7bd8) failed (EGL_NOT_INITIALIZED)

I/gralloc (  151): [File] : hardware/rockchip/libgralloc/gralloc_module.cpp; [Line] : 66; [Func] : gralloc_device_open;

I/gralloc (  151): to open device 'fb0' in gralloc_module with ver '1.0.2' on arm_release_ver 'r6p0-02rel0', built at '12:51:53', on 'Jun 12 2018'.

D/gralloc (  151): gralloc_device_open new neiw fd=11

D/gralloc (  151): g_MMU_stat=0

I/gralloc (  151): [File] : hardware/rockchip/libgralloc/gralloc_module.cpp; [Line] : 66; [Func] : gralloc_device_open;

I/gralloc (  151): to open device 'gpu0' in gralloc_module with ver '1.0.2' on arm_release_ver 'r6p0-02rel0', built at '12:51:53', on 'Jun 12 2018'.

D/gralloc (  151): gralloc_device_open new neiw fd=11

D/gralloc (  151): g_MMU_stat=0

I/[Gralloc](  151): using (fd=12)

I/[Gralloc](  151): id           = fb0

I/[Gralloc](  151): xres         = 1024 px

I/[Gralloc](  151): yres         = 600 px

I/[Gralloc](  151): xres_virtual = 1024 px

I/[Gralloc](  151): yres_virtual = 1800 px

I/[Gralloc](  151): bpp          = 32

I/[Gralloc](  151): r            = 16:8

I/[Gralloc](  151): g            =  8:8

I/[Gralloc](  151): b            =  0:8

I/[Gralloc](  151): format       = 2

I/[Gralloc](  151): width        = 163 mm (159.568100 dpi)

I/[Gralloc](  151): height       = 95 mm (160.421051 dpi)

I/[Gralloc](  151): refresh rate = 54.51 Hz

D/hwcomposer(  151): hwc_device_open(8694):Open hwc device in thread=151

D/hwcomposer(  151): context->ddrFd ok

I/gralloc (  151): [File] : hardware/rockchip/libgralloc/gralloc_module.cpp; [Line] : 66; [Func] : gralloc_device_open;

I/gralloc (  151): to open device 'gpu0' in gralloc_module with ver '1.0.2' on arm_release_ver 'r6p0-02rel0', built at '12:51:53', on 'Jun 12 2018'.

D/gralloc (  151): gralloc_device_open new neiw fd=17

D/gralloc (  151): g_MMU_stat=0

D/hwcomposer(  151): Dim buffer alloc fd [1024x600,f=4],fd=18 

D/hwcomposer(  151): Frame buffer alloc fd [32x32,f=4],fd=19 

D/hwcomposer(  151): RGA HWComposer verison1.0.0

D/hwcomposer(  151): Device:               0xb76c8048

D/hwcomposer(  151): fb_fps=54.506001

D/hwcomposer(  151): RK_GRAPHICS_VER=commit-id:

D/hwcomposer(  151):  rga version =2.000

I/SurfaceFlinger(  151): Using composer version 1.3

W/SurfaceFlinger(  151): no suitable EGLConfig found, trying a simpler query

F/SurfaceFlinger(  151): no suitable EGLConfig found, giving up

F/libc    (  151): Fatal signal 6 (SIGABRT), code -6 in tid 151 (surfaceflinger)

D/hwcomposer(  151): hwc_control_3dmode_thread creat

I/DEBUG   (  154): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

I/DEBUG   (  154): Build fingerprint: 'Android/rk3288/rk3288:5.1.1/LMY49F/stonecom06121244:eng/release-keys'

I/DEBUG   (  154): Revision: '0'

I/DEBUG   (  154): ABI: 'arm'

I/DEBUG   (  154): pid: 151, tid: 151, name: surfaceflinger  >>> /system/bin/surfaceflinger <<<

I/DEBUG   (  154): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------

I/DEBUG   (  154): Abort message: 'no suitable EGLConfig found, giving up'

I/DEBUG   (  154):     r0 00000000  r1 00000097  r2 00000006  r3 00000000

I/DEBUG   (  154):     r4 b6f3ae38  r5 00000006  r6 00000000  r7 0000010c

I/DEBUG   (  154):     r8 b76be550  r9 00000000  sl 00000000  fp 00000001

I/DEBUG   (  154):     ip 00000097  sp bef51280  lr b6ea6db1  pc b6ecced8  cpsr 600e0010

I/DEBUG   (  154): 

I/DEBUG   (  154): backtrace:

I/DEBUG   (  154):     #00 pc 0003ced8  /system/lib/libc.so (tgkill+12)

I/DEBUG   (  154):     #01 pc 00016dad  /system/lib/libc.so (pthread_kill+52)

I/DEBUG   (  154):     #02 pc 000179bf  /system/lib/libc.so (raise+10)

I/DEBUG   (  154):     #03 pc 00014165  /system/lib/libc.so (__libc_android_abort+36)

I/DEBUG   (  154):     #04 pc 000124ec  /system/lib/libc.so (abort+4)

I/DEBUG   (  154):     #05 pc 00007bb9  /system/lib/libcutils.so (__android_log_assert+88)

I/DEBUG   (  154):     #06 pc 000284f9  /system/lib/libsurfaceflinger.so

I/DEBUG   (  154):     #07 pc 000280f5  /system/lib/libsurfaceflinger.so

I/DEBUG   (  154):     #08 pc 0001849b  /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::init()+158)

I/DEBUG   (  154):     #09 pc 00000b55  /system/bin/surfaceflinger

I/DEBUG   (  154):     #10 pc 0001239d  /system/lib/libc.so (__libc_init+44)

I/DEBUG   (  154):     #11 pc 00000c74  /system/bin/surfaceflinger

I/DEBUG   (  154): 

I/DEBUG   (  154): Tombstone written to: /data/tombstones/tombstone_07

I/ServiceManager(  148): service 'media.audio_flinger' died

I/Netd    (  423): Netd 1.0 starting

I/SurfaceFlinger(  424): SurfaceFlinger is starting

I/SurfaceFlinger(  424): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...

D/libEGL  (  424): loaded /vendor/lib/egl/libGLES_mali.so

I/mali_so (  424): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 780; [Func] : base_context_deal_with_version_affairs_rk_ext;

I/mali_so (  424): arm_release_ver of this mali_so is 'r6p0-02rel0', rk_so_ver is '11@0', built at '17:59:04', on 'Aug 12 2015'.

E/mali_so (  424): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 834; [Func] : get_ver_info_from_mali_ko_rk_ext;

E/mali_so (  424): Function call returned error : err = 3.

E/mali_so (  424): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 782; [Func] : base_context_deal_with_version_affairs_rk_ext;

E/mali_so (  424): Function call returned error : err = 3.

E/mali_so (  424): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_context.c; [Line] : 236; [Func] : basep_context_init;

E/mali_so (  424): fail to deal with version affairs of rk_ext. err : 3.

E/mali    (  424): ERROR: The DDK is not compatible with any of the Mali GPUs on the system.

E/mali    (  424): The DDK was built for 0x750 r0p0 status range [1..1], but none of the GPUs matched:

I/mali_so (  424): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 780; [Func] : base_context_deal_with_version_affairs_rk_ext;

I/mali_so (  424): arm_release_ver of this mali_so is 'r6p0-02rel0', rk_so_ver is '11@0', built at '17:59:04', on 'Aug 12 2015'.

E/mali_so (  424): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 834; [Func] : get_ver_info_from_mali_ko_rk_ext;

E/mali_so (  424): Function call returned error : err = 3.

E/mali_so (  424): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 782; [Func] : base_context_deal_with_version_affairs_rk_ext;

E/mali_so (  424): Function call returned error : err = 3.

E/mali_so (  424): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_context.c; [Line] : 236; [Func] : basep_context_init;

E/mali_so (  424): fail to deal with version affairs of rk_ext. err : 3.

W/libEGL  (  424): eglInitialize(0xb7623c20) failed (EGL_NOT_INITIALIZED)

I/gralloc (  424): [File] : hardware/rockchip/libgralloc/gralloc_module.cpp; [Line] : 66; [Func] : gralloc_device_open;

I/gralloc (  424): to open device 'fb0' in gralloc_module with ver '1.0.2' on arm_release_ver 'r6p0-02rel0', built at '12:51:53', on 'Jun 12 2018'.

D/gralloc (  424): gralloc_device_open new neiw fd=11

D/gralloc (  424): g_MMU_stat=0

I/gralloc (  424): [File] : hardware/rockchip/libgralloc/gralloc_module.cpp; [Line] : 66; [Func] : gralloc_device_open;

I/gralloc (  424): to open device 'gpu0' in gralloc_module with ver '1.0.2' on arm_release_ver 'r6p0-02rel0', built at '12:51:53', on 'Jun 12 2018'.

D/gralloc (  424): gralloc_device_open new neiw fd=11

D/gralloc (  424): g_MMU_stat=0

I/[Gralloc](  424): using (fd=12)

I/[Gralloc](  424): id           = fb0

I/[Gralloc](  424): xres         = 1024 px

I/[Gralloc](  424): yres         = 600 px

I/[Gralloc](  424): xres_virtual = 1024 px

I/[Gralloc](  424): yres_virtual = 1800 px

I/[Gralloc](  424): bpp          = 32

I/[Gralloc](  424): r            = 16:8

I/[Gralloc](  424): g            =  8:8

I/[Gralloc](  424): b            =  0:8

I/[Gralloc](  424): format       = 2

I/[Gralloc](  424): width        = 163 mm (159.568100 dpi)

I/[Gralloc](  424): height       = 95 mm (160.421051 dpi)

I/[Gralloc](  424): refresh rate = 54.51 Hz

D/hwcomposer(  424): hwc_device_open(8694):Open hwc device in thread=424

D/hwcomposer(  424): context->ddrFd ok

I/gralloc (  424): [File] : hardware/rockchip/libgralloc/gralloc_module.cpp; [Line] : 66; [Func] : gralloc_device_open;

I/gralloc (  424): to open device 'gpu0' in gralloc_module with ver '1.0.2' on arm_release_ver 'r6p0-02rel0', built at '12:51:53', on 'Jun 12 2018'.

D/gralloc (  424): gralloc_device_open new neiw fd=17

D/gralloc (  424): g_MMU_stat=0

W/linker  (  425): libffmpeg.so has text relocations. This is wasting memory and prevents security hardening. Please fix.

I/mediaserver(  425): ServiceManager: 0xb88c57f8

I/AudioFlinger(  425): Using default 3000 mSec as standby time.

I/ServiceManager(  425): Waiting for service batterystats...

D/hwcomposer(  424): Dim buffer alloc fd [1024x600,f=4],fd=18 

D/hwcomposer(  424): Frame buffer alloc fd [32x32,f=4],fd=19 

D/hwcomposer(  424): RGA HWComposer verison1.0.0

D/hwcomposer(  424): Device:               0xb7624040

D/hwcomposer(  424): fb_fps=54.506001

D/hwcomposer(  424): RK_GRAPHICS_VER=commit-id:

D/hwcomposer(  424):  rga version =2.000

I/SurfaceFlinger(  424): Using composer version 1.3

W/SurfaceFlinger(  424): no suitable EGLConfig found, trying a simpler query

F/SurfaceFlinger(  424): no suitable EGLConfig found, giving up

F/libc    (  424): Fatal signal 6 (SIGABRT), code -6 in tid 424 (surfaceflinger)

D/hwcomposer(  424): hwc_control_3dmode_thread creat

D/AndroidRuntime(  426): >>>>>> START com.android.internal.os.ZygoteInit uid 0 <<<<<<

I/DEBUG   (  154): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

I/DEBUG   (  154): Build fingerprint: 'Android/rk3288/rk3288:5.1.1/LMY49F/stonecom06121244:eng/release-keys'

I/DEBUG   (  154): Revision: '0'

I/DEBUG   (  154): ABI: 'arm'

I/DEBUG   (  154): pid: 424, tid: 424, name: surfaceflinger  >>> /system/bin/surfaceflinger <<<

I/DEBUG   (  154): signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------

D/AndroidRuntime(  426): CheckJNI is OFF

I/AndroidRuntime(  426): JNI options: '-Xjniopts:warnonly'

I/art     (  426): option[0]=-Xzygote

I/art     (  426): option[1]=-Xstacktracefile:/data/anr/traces.txt

I/art     (  426): option[2]=-Xjniopts:warnonly

I/art     (  426): option[3]=exit

I/art     (  426): option[4]=vfprintf

I/art     (  426): option[5]=sensitiveThread

I/art     (  426): option[6]=-verbose:gc

I/art     (  426): option[7]=-Xms16m

I/art     (  426): option[8]=-Xmx512m

I/art     (  426): option[9]=-XX:mainThreadStackSize=24K

I/art     (  426): option[10]=-XX:HeapGrowthLimit=192m

I/art     (  426): option[11]=-XX:HeapMinFree=512k

I/art     (  426): option[12]=-XX:HeapMaxFree=8m

I/art     (  426): option[13]=-XX:HeapTargetUtilization=0.75

I/art     (  426): option[14]=-Xgenregmap

I/art     (  426): option[15]=-Xgc:precise

I/art     (  426): option[16]=-agentlib:jdwp=transport=dt_android_adb,suspend=n,server=y

I/art     (  426): option[17]=-Ximage-compiler-option

I/art     (  426): option[18]=--runtime-arg

I/art     (  426): option[19]=-Ximage-compiler-option

I/art     (  426): option[20]=-Xms64m

I/art     (  426): option[21]=-Ximage-compiler-option

I/art     (  426): option[22]=--runtime-arg

I/art     (  426): option[23]=-Ximage-compiler-option

I/art     (  426): option[24]=-Xmx64m

I/art     (  426): option[25]=-Ximage-compiler-option

I/art     (  426): option[26]=--compiler-filter=verify-none

I/art     (  426): option[27]=-Ximage-compiler-option

I/art     (  426): option[28]=--image-classes=/system/etc/preloaded-classes

I/art     (  426): option[29]=-Xcompiler-option

I/art     (  426): option[30]=--runtime-arg

I/art     (  426): option[31]=-Xcompiler-option

I/art     (  426): option[32]=-Xms64m

I/art     (  426): option[33]=-Xcompiler-option

I/art     (  426): option[34]=--runtime-arg

I/art     (  426): option[35]=-Xcompiler-option

I/art     (  426): option[36]=-Xmx512m

I/art     (  426): option[37]=-Xcompiler-option

I/art     (  426): option[38]=--compiler-filter=interpret-only

I/art     (  426): option[39]=-Duser.language=en

I/art     (  426): option[40]=-Duser.region=US

W/art     (  426): Incomplete boot detected. Pruning dalvik cache

I/DEBUG   (  154): Abort message: 'no suitable EGLConfig found, giving up'

I/DEBUG   (  154):     r0 00000000  r1 000001a8  r2 00000006  r3 00000000

I/DEBUG   (  154):     r4 b6f45e38  r5 00000006  r6 00000000  r7 0000010c

I/DEBUG   (  154):     r8 b761a550  r9 00000000  sl 00000000  fp 00000001

I/DEBUG   (  154):     ip 000001a8  sp bef97280  lr b6eb1db1  pc b6ed7ed8  cpsr 600e0010

I/DEBUG   (  154): 

I/DEBUG   (  154): backtrace:

I/DEBUG   (  154):     #00 pc 0003ced8  /system/lib/libc.so (tgkill+12)

I/DEBUG   (  154):     #01 pc 00016dad  /system/lib/libc.so (pthread_kill+52)

I/DEBUG   (  154):     #02 pc 000179bf  /system/lib/libc.so (raise+10)

I/DEBUG   (  154):     #03 pc 00014165  /system/lib/libc.so (__libc_android_abort+36)

I/DEBUG   (  154):     #04 pc 000124ec  /system/lib/libc.so (abort+4)

I/DEBUG   (  154):     #05 pc 00007bb9  /system/lib/libcutils.so (__android_log_assert+88)

I/DEBUG   (  154):     #06 pc 000284f9  /system/lib/libsurfaceflinger.so

I/DEBUG   (  154):     #07 pc 000280f5  /system/lib/libsurfaceflinger.so

I/DEBUG   (  154):     #08 pc 0001849b  /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::init()+158)

I/DEBUG   (  154):     #09 pc 00000b55  /system/bin/surfaceflinger

I/DEBUG   (  154):     #10 pc 0001239d  /system/lib/libc.so (__libc_init+44)

I/DEBUG   (  154):     #11 pc 00000c74  /system/bin/surfaceflinger

W/art     (  426): Invalid image header in '/data/dalvik-cache/arm/system@framework@boot.art'

I/art     (  426): Pruning dalvik-cache since we are generating an image and will need to recompile

I/art     (  426): Using an offset of 0x3cf000 from default art base address of 0x70000000

I/art     (  426): GenerateImage: /system/bin/dex2oat --image=/data/dalvik-cache/arm/system@framework@boot.art --dex-file=/system/framework/core-libart.jar --dex-file=/system/framework/conscrypt.jar --dex-file=/system/framework/okhttp.jar --dex-file=/system/framework/core-junit.jar --dex-file=/system/framework/bouncycastle.jar --dex-file=/system/framework/ext.jar --dex-file=/system/framework/framework.jar --dex-file=/system/framework/telephony-common.jar --dex-file=/system/framework/voip-common.jar --dex-file=/system/framework/ims-common.jar --dex-file=/system/framework/mms-common.jar --dex-file=/system/framework/android.policy.jar --dex-file=/system/framework/apache-xml.jar --oat-file=/data/dalvik-cache/arm/system@framework@boot.oat --instruction-set=arm --instruction-set-features=div --base=0x703cf000 --runtime-arg -Xms64m --runtime-arg -Xmx64m --compiler-filter=verify-none --image-classes=/system/etc/preloaded-classes

I/dex2oat (  506): /system/bin/dex2oat --image=/data/dalvik-cache/arm/system@framework@boot.art --dex-file=/system/framework/core-libart.jar --dex-file=/system/framework/conscrypt.jar --dex-file=/system/framework/okhttp.jar --dex-file=/system/framework/core-junit.jar --dex-file=/system/framework/bouncycastle.jar --dex-file=/system/framework/ext.jar --dex-file=/system/framework/framework.jar --dex-file=/system/framework/telephony-common.jar --dex-file=/system/framework/voip-common.jar --dex-file=/system/framework/ims-common.jar --dex-file=/system/framework/mms-common.jar --dex-file=/system/framework/android.policy.jar --dex-file=/system/framework/apache-xml.jar --oat-file=/data/dalvik-cache/arm/system@framework@boot.oat --instruction-set=arm --instruction-set-features=div --base=0x703cf000 --runtime-arg -Xms64m --runtime-arg -Xmx64m --compiler-filter=verify-none --image-classes=/system/etc/preloaded-classes

I/DEBUG   (  154): 
....
I/SurfaceFlinger(  705): SurfaceFlinger is starting

I/SurfaceFlinger(  705): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...

D/libEGL  (  705): loaded /vendor/lib/egl/libGLES_mali.so

I/mali_so (  705): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 780; [Func] : base_context_deal_with_version_affairs_rk_ext;

I/mali_so (  705): arm_release_ver of this mali_so is 'r6p0-02rel0', rk_so_ver is '11@0', built at '17:59:04', on 'Aug 12 2015'.

E/mali_so (  705): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 834; [Func] : get_ver_info_from_mali_ko_rk_ext;

E/mali_so (  705): Function call returned error : err = 3.

E/mali_so (  705): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 782; [Func] : base_context_deal_with_version_affairs_rk_ext;

E/mali_so (  705): Function call returned error : err = 3.

E/mali_so (  705): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_context.c; [Line] : 236; [Func] : basep_context_init;

E/mali_so (  705): fail to deal with version affairs of rk_ext. err : 3.

E/mali    (  705): ERROR: The DDK is not compatible with any of the Mali GPUs on the system.

E/mali    (  705): The DDK was built for 0x750 r0p0 status range [1..1], but none of the GPUs matched:

I/mali_so (  705): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 780; [Func] : base_context_deal_with_version_affairs_rk_ext;

I/mali_so (  705): arm_release_ver of this mali_so is 'r6p0-02rel0', rk_so_ver is '11@0', built at '17:59:04', on 'Aug 12 2015'.

E/mali_so (  705): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 834; [Func] : get_ver_info_from_mali_ko_rk_ext;

E/mali_so (  705): Function call returned error : err = 3.

E/mali_so (  705): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_kbase.c; [Line] : 782; [Func] : base_context_deal_with_version_affairs_rk_ext;

E/mali_so (  705): Function call returned error : err = 3.

E/mali_so (  705): [File] : hardware/arm/maliT760/driver/product/base/src/mali_base_context.c; [Line] : 236; [Func] : basep_context_init;

E/mali_so (  705): fail to deal with version affairs of rk_ext. err : 3.

W/libEGL  (  705): eglInitialize(0xb881bbe0) failed (EGL_NOT_INITIALIZED)

I/gralloc (  705): [File] : hardware/rockchip/libgralloc/gralloc_module.cpp; [Line] : 66; [Func] : gralloc_device_open;

I/gralloc (  705): to open device 'fb0' in gralloc_module with ver '1.0.2' on arm_release_ver 'r6p0-02rel0', built at '12:51:53', on 'Jun 12 2018'.

D/gralloc (  705): gralloc_device_open new neiw fd=11

D/gralloc (  705): g_MMU_stat=0

I/gralloc (  705): [File] : hardware/rockchip/libgralloc/gralloc_module.cpp; [Line] : 66; [Func] : gralloc_device_open;

I/gralloc (  705): to open device 'gpu0' in gralloc_module with ver '1.0.2' on arm_release_ver 'r6p0-02rel0', built at '12:51:53', on 'Jun 12 2018'.

D/gralloc (  705): gralloc_device_open new neiw fd=11

D/gralloc (  705): g_MMU_stat=0

I/[Gralloc](  705): using (fd=12)

I/[Gralloc](  705): id           = fb0

I/[Gralloc](  705): xres         = 1024 px

从logcat 日志可以看出surfaceflinger 已经崩溃了。
我们知道 surfaceflinger是Android的标准框架之一,不会有大的bug,而且我没有修改任何surfaceflinger 的内容,所以考虑之后只能是kernel初始化加载相关模块出现错误导致surfaceflinger 获取资源失败,
所以自己对比 正常开机和错误的 kernel 相关日志,
其中这段文字很重要
mali_kbase: version magic ‘3.10.0 SMP preempt mod_unload ARMv7 p2v8 ’ should be ‘3.10.0+ SMP preempt mod_unload ARMv7 p2v8 ‘
正常开机不会存在这个日志的。而且正常开机会打印很多 GPU驱动初始化相关信息。

[    4.081418] mali ffa30000.gpu: Continuing without Mali clock control
[    4.081451] mali pd enabled
[    4.081458] clk enabled
[    4.082773] MALI_DVFS_STEP = 5, div_dvfs = 7 
[    4.082782] mali_dvfs_infotbl[0].clock=99000,min_threshold=0,max_threshold=70
[    4.082789] mali_dvfs_infotbl[1].clock=198000,min_threshold=65,max_threshold=77
[    4.082795] mali_dvfs_infotbl[2].clock=297000,min_threshold=75,max_threshold=84
[    4.082802] mali_dvfs_infotbl[3].clock=417000,min_threshold=82,max_threshold=91
[    4.082808] mali_dvfs_infotbl[4].clock=480000,min_threshold=94,max_threshold=100
[    4.082893] gpufreq_input_connect
[    4.082903] turn on mali power
[    4.082910] kbase_platform_rk_init,register_reboot_notifier
[    4.082949] hrtimer: interrupt took 10791 ns
[    4.083031] mali ffa30000.gpu: GPU identified as 0x0750 r0p0 status 1
[    4.085077] mali ffa30000.gpu: Probed as mali0

这些都不在开机失败的kernel日志中,所以初步判断是mali(GPU)初始化 失败,查找失败打印的日志在源码中的位置
kernel/kernel/module.c

static int check_modinfo(struct module *mod, struct load_info *info, int flags)
{
    const char *modmagic = get_modinfo(info, "vermagic");
    int err;

    if (flags & MODULE_INIT_IGNORE_VERMAGIC)
        modmagic = NULL;

    /* This is allowed: modprobe --force will invalidate it. */
    if (!modmagic) {
        err = try_to_force_load(mod, "bad vermagic");
        if (err)
            return err;
    } else if (!same_magic(modmagic, vermagic, info->index.vers)) {
        printk(KERN_ERR "%s: version magic '%s' should be '%s'\n",
               mod->name, modmagic, vermagic);
        return -ENOEXEC;
    }

    if (!get_modinfo(info, "intree"))
        add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK);

    if (get_modinfo(info, "staging")) {
        add_taint_module(mod, TAINT_CRAP, LOCKDEP_STILL_OK);
        printk(KERN_WARNING "%s: module is from the staging directory,"
               " the quality is unknown, you have been warned.\n",
               mod->name);
    }

    /* Set up license info based on the info section */
    set_license(mod, get_modinfo(info, "license"));

    return 0;
}

这个函数被layout_and_allocate(初始化模块分配内存)函数引用,layout_and_allocate被load_module(主要加载驱动模块)
mali_kbase: version magic ‘3.10.0 SMP preempt mod_unload ARMv7 p2v8 ’ should be ‘3.10.0+ SMP preempt mod_unload ARMv7 p2v8 ’
就是check_modinfo 函数中

printk(KERN_ERR "%s: version magic '%s' should be '%s'\n",
               mod->name, modmagic, vermagic);
static inline int same_magic(const char *amagic, const char *bmagic,
                 bool has_crcs)
{
    if (has_crcs) {
        amagic += strcspn(amagic, " ");
        bmagic += strcspn(bmagic, " ");
    }
    return strcmp(amagic, bmagic) == 0;
}

对比vermagic信息是否相等
modmagic = 3.10.0 SMP preempt mod_unload ARMv7 p2v8
vermagic = 3.10.0+ SMP preempt mod_unload ARMv7 p2v8
两者明显不相等。
我自己根本没有改动过相关kernel 源码,怎么会多出来一个 + 号,
vermagic 的内核源码定义为

static const char vermagic[] = VERMAGIC_STRING;
#define VERMAGIC_STRING                         \
    UTS_RELEASE " "                         \
    MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT             \
    MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS   \
    MODULE_ARCH_VERMAGIC

其中 #define UTS_RELEASE “3.10.0+” 文件位置是include/generated/utsrelease.h
utsrelease.h 是一个编译生成的文件,直接修改这个文件不起作用,
只有找到在哪生成修改才行,在Make file 有

(echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";)
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)

看来UTS_RELEASE 是由include/config/kernel.release生成的,

cat include/config/kernel.release
3.10.0+

而kernel.release这个文件也不是系统自己就有的,也是编译时候生成的,在搜索Makefile得到

# Store (new) KERNELRELASE string in include/config/kernel.release
include/config/kernel.release: include/config/auto.conf FORCE
    $(Q)rm -f $@
    $(Q)echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctre
e))" > $@

看来是由setlocalversion这个脚本生成的,

if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then
    # full scm version string
    res="$res$(scm_version)"
else
    # append a plus sign if the repository is not in a clean
    # annotated or signed tagged state (as git describe only
    # looks at signed or annotated tags - git tag -a/-s) and
    # LOCALVERSION= is not specified
    if test "${LOCALVERSION+set}" != "set"; then
        scm=$(scm_version --short)
        res="$res${scm:++}"
    fi
fi

如果定义了CONFIG_LOCALVERSION_AUTO(CONFIG_LOCALVERSION_AUTO=y)
此时会执行第一个if下的脚本。执行res=”resres(scm_version)”
如果代码属于git管理:
打了tag,则会添加tag相关字符;
没有打tag,则会添加log相加字符,例如最新的commit是
commit cdebe039ded3e7fcd00c6e5603a878b14d7e564e
则编译之后文件include/config/kernel.release的内容为2.6.35.7-gcdeb
2.2. 如果没有定义了CONFIG_LOCALVERSION_AUTO。
此时会执行else下的脚本。
A. 如果没有定义LOCALVERSION,版本号后面会添加“+”号:执行else里的if下的脚本scm=$(scm_version –short),在函数scm_version –short里,如果传入参数short会添加“+”号,

  if $short; then
    echo "+"
    return
   fi

B. 定义了LOCALVERSION则不会执行else里if所在的脚本,从而不会在后面添加“+”号。
C. LOCALVERSION变量可在命令行定义:
make LOCALVERSION=.88 include/config/kernel.release
或者添加为环境变量。
如果既不想添加字符,又不想有“+”号:不定义CONFIG_LOCALVERSION_AUTO,将LOCALVERSION变量定义为空:LOCALVERSION=
另外一中简单方法修改直接

#define VERMAGIC_STRING                         \
    "3.10.0" " "                            \
    MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT             \
    MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS   \
    MODULE_ARCH_VERMAGIC

重新编译Android 源码, 解决问题!!!!!!!!!

<think>我们正在处理一个关于RK3588设备卡在开机动画的问题。根据引用资料,我们可以知道RK3588平台的开机动画通常是通过将bootanimation.zip文件放置在/system/media/目录下来实现的(引用[1])。此外,引用[3]提到在iTop3588平台上移植OpenHarmony时,需要确保uboot logo、kernel logo和开机动画的正常显示。 用户的问题:设备卡在开机动画,说明系统可能无法正常启动到桌面,而是停留在开机动画阶段。这可能是由于开机动画本身的问题,也可能是系统启动过程中其他环节的问题解决方案思路: 1. **检查开机动画文件**:首先确认bootanimation.zip文件是否正确。如果文件损坏或者格式不正确,可能导致动画无法正常播放,从而卡住。 2. **检查系统启动流程**:在显示开机动画之后,系统应该继续启动服务并进入桌面。如果系统服务启动失败,也可能导致卡在开机动画。 具体步骤: ### 1. 检查开机动画文件 - 确保`bootanimation.zip`文件存在于`/system/media/`目录下(引用[1])。 - 验证该文件的权限是否正确(通常为644,即rw-r--r--)。 - 检查文件内容:开机动画文件通常包含一个`desc.txt`文件和若干图片文件夹。我们可以尝试解压这个文件,检查其结构是否正确。 如果无法进入系统,可以通过以下方式检查: - 使用ADB连接设备(如果设备开启了ADB调试)。在卡在开机动画时,尝试使用`adb shell`进入设备,然后检查文件。 - 如果ADB无法连接,可能需要进入恢复模式(Recovery)或使用串口调试。 ### 2. 替换或移除开机动画 - 如果怀疑是开机动画文件的问题,可以尝试替换为一个已知良好的开机动画文件,或者移除开机动画文件(移除后系统将使用默认的Android开机动画,即显示“Android”字样)。 - 移除方法:在能够访问设备文件系统的情况下(如通过恢复模式),删除`/system/media/bootanimation.zip`文件。 ### 3. 检查系统启动日志 - 通过串口调试或ADB获取系统日志(logcat)和内核日志(dmesg),分析卡在开机动画时的错误信息。 - 查看日志中是否有明显的服务启动失败或异常。 ### 4. 检查文件系统 - 有时文件系统损坏也会导致启动问题。可以尝试在恢复模式下执行文件系统检查(fsck)。 ### 5. 恢复出厂设置或重新烧录系统 - 如果以上方法无效,可以考虑恢复出厂设置(在恢复模式下执行wipe data/factory reset)。注意:这会清除用户数据。 - 如果问题依旧,可能需要重新烧录系统(引用[4]提到使用balenaEtcher烧录系统镜像)。 ### 6. 硬件问题 - 在极少数情况下,可能是硬件问题(如内存不足或存储损坏)导致。需要检查硬件状态。 根据引用[5],在RK3588平台上,系统启动时间被优化,要求上电后3秒内出现开机画面。如果卡在开机动画,可能是启动过程中某个环节超时或失败。 ## 相关问题 §§相关问题§§ 1. 如何制作RK3588平台的开机动画? 2. 如何通过串口调试RK3588设备? 3. RK3588设备启动流程是怎样的? 4. 如何重新烧录RK3588设备的系统?</think>### RK3588设备卡在开机动画的解决方案 #### **问题原因分析** 当RK3588设备卡在开机动画时,通常由以下原因导致: 1. **开机动画文件损坏**:`bootanimation.zip`格式错误或内容异常(引用[1])。 2. **系统服务启动失败**:关键服务(如显示服务、系统UI)未正常加载。 3. **文件系统权限问题**:动画文件权限配置错误或存储介质损坏。 4. **内核/UBOOT异常**:显示驱动或帧缓冲初始化失败(引用[3][5])。 --- #### **解决方案步骤** ##### **1. 检查开机动画文件** ```bash # 通过ADB检查文件完整性 adb shell ls -l /system/media/bootanimation.zip # 确认文件存在 adb shell unzip -t /system/media/bootanimation.zip # 测试ZIP完整性 # 替换默认动画(紧急恢复) adb push new_bootanimation.zip /system/media/ adb shell chmod 644 /system/media/bootanimation.zip ``` - 若文件损坏,从原厂固件提取备份文件替换(引用[1])。 ##### **2. 检查系统日志** ```bash adb logcat | grep "BootAnimation" # 过滤动画进程日志 adb logcat | grep "SurfaceFlinger" # 检查显示服务 dmesg | grep "fb" # 检查帧缓冲驱动 ``` - 关键报错示例: - `BootAnimation exit timeout` → 动画渲染超时 - `SurfaceFlinger failed to start` → 显示服务崩溃 ##### **3. 验证文件系统** ```bash adb shell df -h /system # 检查/system分区空间 adb shell fsck /dev/block/mmcblk0p2 # 检查文件系统错误 ``` - 若`/system`空间不足,删除冗余文件(如旧日志)。 ##### **4. 内核级调试(需串口)** ```text # 串口连接后查看UBOOT日志 => printenv bootargs # 检查启动参数 => bdinfo # 查看内存映射 ``` - 确认`CONFIG_FRAMEBUFFER_CONSOLE=y`已启用(引用[3][5])。 ##### **5. 恢复出厂固件** - 使用balenaEtcher重新烧录官方镜像(引用[4]): 1. 下载适配RK3588的固件(如OpenHarmony或Android)。 2. TF卡烧录后插入设备强制刷机。 --- #### **预防措施** 1. **开机动画制作规范**: - 压缩格式:`store`模式(无压缩) - 分辨率匹配屏幕(如RK3588常支持4K) - 测试命令:`bootanimation`工具预览 2. **系统优化**: - 禁用非必要服务以加速启动(引用[5]) - 启用内核帧缓冲早期初始化(`earlycon`参数) ---
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

九霄的爸爸

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值