Android 系统无法在嵌入式系统的 Docker 容器内正确启动

问题描述 投票:0回答:1

我遇到了 Android 系统无法正常工作的问题,我真的需要你的帮助。我不是 Android 开发人员,所以我不是很熟悉 Android 操作系统或其内部工作原理。但是,我熟悉Linux系统,我明白Android本质上是在Linux之上多了一层

我目前正在做一个项目,我需要启动一个在嵌入式系统上的 Docker 容器内运行的库存 Android 12 版本。我们使用的主板具有 ArmV8 架构,并运行通过 Buildroot 生成的自定义嵌入式 Linux。我有两块规格非常相似的板,使用相同的 SoC(片上系统),硬件或多或少相同,但固件已修改。

在一块板上,我可以从 Linux 终端成功启动容器 Docker 映像中的 Android。显示器(连接到设备上的 HDMI 端口)显示一个普通的 Android 系统,就像您希望在平板电脑上看到的那样,带有图标、桌面等。但是,当我在其他设备上使用完全相同的 Docker 图像时(相同的硬件,不同的固件),系统无法成功启动。

我能够访问未引导至 Android“桌面”的系统的 Android 终端,因此系统至少部分存在。我的理论是 Android 系统没有成功启动,许多服务没有正确初始化。第一个“提示”是消息“cmd:找不到服务:包”。在 shell 中,如果我尝试运行“pm”命令,我会收到此消息。

我专门搜索了“pm”错误,大多数讨论都围绕着人们启动 Android 模拟器,但它没有时间完全启动。建议的修复方法是执行“冷启动”或以某种方式为系统提供更多时间来启动。我并不是在运行模拟器,因为它在 ARMV8 系统上本地运行,但它在容器中运行。

我可以运行 bugreportz 并收集我认为最相关的日志。我已将非工作系统的主日志附加到此线程以供参考。我有来自工作系统和非工作系统的日志,所以我的下一步是梳理日志并尝试找出可能指出为什么一个系统工作而另一个系统不工作的主要差异(例如,错误非工作系统中的消息)。

但是,这里有很多东西需要梳理,而且由于我不熟悉 Android 操作系统,所以我不确定我在寻找什么,或者我是否在正确的地方寻找。我确实在日志中看到许多服务没有出现在非工作系统的日志中。我该如何调试为什么会这样?

有关如何缩小范围的任何帮助、提示或链接,以便我至少在正确的区域寻找,这将非常有帮助。预先感谢您的协助!

日志链接:https://drive.google.com/file/d/1cFHwqAMXZxpdePQ6zJ-2wFZ0bu-0R9df/view?usp=sharing

** 更新 - 在对日志进行了更多梳理之后,我发现上面的日志中看起来像是两个不同的崩溃。第一个看起来是在它试图显示启动动画时发生的。我对 SurfaceFlinger 的理解是它用于发送数据缓冲区以显示给窗口管理器,因此这至少看起来像是一个问题。这次崩溃是否发生得足够早,以至于它阻止了其他服务的加载?

05-08 05:21:34.489  1003    62   136 D BootAnimation: BootAnimationShownTiming start time: 310040ms
--------- beginning of crash
05-08 05:21:34.516  1000    61    61 F libc    : system/libfmq/include/fmq/MessageQueueBase.h:610: assertion "mReadPtr is null" failed
05-08 05:21:34.517  1000    61    61 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 61 (surfaceflinger), pid 61 (surfaceflinger)
05-08 05:21:34.663  root   191   191 I gsid    : no DSU: No such file or directory
05-08 05:21:34.669  1000   158   158 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-08 05:21:34.669  1000   158   158 F DEBUG   : Build fingerprint: 'rockchip/rk3588/rk3588:12/SQ3A.220605.009.B1/lisd12291420:userdebug/release-keys'
05-08 05:21:34.669  1000   158   158 F DEBUG   : Revision: '0'
05-08 05:21:34.669  1000   158   158 F DEBUG   : ABI: 'arm64'
05-08 05:21:34.669  1000   158   158 F DEBUG   : Timestamp: 2023-05-08 05:21:34.551424227+0000
05-08 05:21:34.669  1000   158   158 F DEBUG   : Process uptime: 2s
05-08 05:21:34.669  1000   158   158 F DEBUG   : Cmdline: /system/bin/surfaceflinger
05-08 05:21:34.669  1000   158   158 F DEBUG   : pid: 61, tid: 61, name: surfaceflinger  >>> /system/bin/surfaceflinger <<<
05-08 05:21:34.669  1000   158   158 F DEBUG   : uid: 1000
05-08 05:21:34.669  1000   158   158 F DEBUG   : tagged_addr_ctrl: 0000000000000001
05-08 05:21:34.669  1000   158   158 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
05-08 05:21:34.669  1000   158   158 F DEBUG   : Abort message: 'system/libfmq/include/fmq/MessageQueueBase.h:610: assertion "mReadPtr is null" failed'

这些是唯一在非工作设备上运行的服务。SurfaceFlinger 不是其中之一:

image:android.hardware.light.ILights/default
android.hardware.power.IPower/default
android.security.apc
android.security.authorization
android.security.compat
android.security.identity
android.security.legacykeystore
android.security.maintenance
android.security.metrics
android.service.gatekeeper.IGateKeeperService
android.system.keystore2.IKeystoreService/default
drm.drmManager
idmap
incident
installd
manager
media.extractor
media.metrics
stats
storaged
storaged_pri
suspend_control
suspend_control_internal
vold
android docker arm embedded-linux
1个回答
0
投票

已解决。在此过程中了解了更多有关 android 启动的信息。运行 bugreportz 非常好,但是一个简单的“logcat”输出到一个文件就可以为您提供查看 android 系统启动所需的几乎所有内容。对我来说,这就是问题所在:

 "05-09 00:15:04.048  1000   538   538 E ashmem  : Unable to open ashmem device /dev/ashmem41f198eb-231d-41bb-8928-f9dfb3712a2d (error = No such file or directory) and /dev/ashmem(error = No such file or directory)
05-09 00:15:04.048  1000   538   538 E FMQ     : mmap failed: 9
05-09 00:15:04.048  1000   538   538 F libc    : system/libfmq/include/fmq/MessageQueueBase.h:610: assertion "mReadPtr is null" failed
05-09 00:15:04.049  1000   538   538 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 538 (surfaceflinger), pid 538 (surfaceflinger)

有一个名为“ashmem”的 linux 内核模块。该模块存在于工作系统的内核中,但不存在于其他系统中。换句话说,linux 内核不匹配并且缺少需求

© www.soinside.com 2019 - 2024. All rights reserved.