简体   繁体   English

替换system.img后无法启动Android设备

[英]Can't boot Android device after replacing system.img

I am working on a custom android device using the i.MX53 board from NXP (formerly Freescale). 我正在使用NXP(以前称为Freescale)的i.MX53板在自定义android设备上工作。 I have the OS source code, various intermediate files, and the final resulting files once produced by another developer (who customized the OS, but has since left our company). 我有OS源代码,各种中间文件以及最终的文件,这些文件是由另一个开发人员(他自定义OS,但此后离开我们公司)制作的。 I now need to modify the contents of the system partition on these devices. 现在,我需要在这些设备上修改系统分区的内容。 I have attempted to build and load a new system.img file using make_ext4fs.exe and the directory which contains the original collection of files the prior developer must have used. 我尝试使用make_ext4fs.exe和包含先前开发人员必须使用的原始文件集合的目录来构建和加载新的system.img文件。 I believe I have created a nearly identical system image, as the one previously used. 我相信我已经创建了与以前使用的系统映像几乎相同的系统映像。 They are both ext4, 200MB. 它们都是ext4,200MB。

There is a utility for this board (called MfgTool) which copies and mounts images automatically for you at the click of a button. 该板有一个实用程序(称为MfgTool),单击某个按钮即可自动为您复制和安装图像。 That MfgTool successfully writes my image to the device. MfgTool成功将我的图像写入设备。 When I try to boot, however, it fails and just loops with the custom boot image being displayed. 但是,当我尝试引导时,它会失败,并且会与正在显示的自定义引导映像一起循环播放。 If I swap out the new system image and restore the prior one in this process, everything works again. 如果我换出新的系统映像并在此过程中还原先前的映像,则一切都会恢复。 So it has to simply be a matter of getting this system image built correctly. 因此,只需简单地正确构建此系统映像即可。

What might be the cause? 可能是什么原因? What difference in the images might cause this? 图像有什么不同可能会导致这种情况? Is it possible there is a signature needed, or some other kind of protection which I'm failing to account for? 是否可能需要签名,或者我无法解释的其他某种保护?

Replace one of the system image service executable with a shell that dump kmsg and logcat to a file (in data partition or external storage for example) and then call the original executable. 用将kmsg和logcat转储到文件(例如,在数据分区或外部存储中)的外壳程序替换系统映像服务可执行文件之一,然后调用原始可执行文件。 Then, boot to your previous system and collect those logs. 然后,启动到先前的系统并收集这些日志。

It turned out that my primary problem was that I need to set the mount point for the image to "system" NOT "/system" when it was created via make_ext4fs despite all documentation out there to the contrary! 原来,我的主要问题是,尽管通过所有文件进行了相反的修改,但通过make_ext4fs创建映像时,我仍需要将映像的安装点设置为“ system”而不是“ / system”! I figured this out by carefully reading the ASOP source: ...build\\tools\\releasetools\\img_from_target_files. 我通过仔细阅读ASOP源代码来了解这一点:... build \\ tools \\ releasetools \\ img_from_target_files。

Of note, after this hurdle, I ran it another problem where the device was acting funky. 值得注意的是,在经历了这一障碍之后,我又遇到了另一个问题,那就是该设备运行起来很时髦。 That turned out to be the result of not having any symbolic links in the image. 原来是图像中没有任何符号链接的结果。 It seems like at the least you normally have symbolic links directing your "bash" commands to the toolbox binary in system/bin. 看来至少您通常具有符号链接,这些符号链接将“ bash”命令定向到system / bin中的工具箱二进制文件。 I don't know how you normally get those, but creating those links and then bundling them into the image fixed that. 我不知道您通常如何获得这些链接,但是创建了这些链接,然后将它们捆绑到固定的图像中。 I suggest checking the bin directory for symbolic links if you manually create a system image like this. 如果您手动创建这样的系统映像,建议您在bin目录中检查符号链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM