使用abootimg解压缩/打包AOSP恢复映像无法启动

时间:2015-07-14 00:06:12

标签: android android-source recovery initrd

我使用AOSP源代码为我的Nexus 7设备构建了recovery.img(使用flo午餐设置)。我可以像以下一样使用它:

$ adb reboot bootloader
$ fastboot boot recovery.img

但是,当我使用abootimg实用程序解压缩并重新打包recovery.img文件(不对ramdisk进行任何修改)并使用recovery.img重新启动时,我的Nexus 7只会进入Google启动画面循环。设备在进入启动画面后不断重启。

详情请参阅以下步骤:

$ ls
recovery.img
$ abootimg -x recovery.img
$ abootimg-unpack-initrd initrd.img
$ abootimg-pack-initrd myinitrd.img ./ramdisk
$ abootimg -u recovery.img -r myinitrd.img

结果更新后的recovery.img无法正常工作,即使它只是原始recovery.img文件的未经修改的副本。

1 个答案:

答案 0 :(得分:0)

几个星期前我遇到了同样的问题,但是使用启动映像,而不是恢复...我发现唯一的解决方案是在使用安装后从设备中提取的img文件中提取initfs dd命令:

dd if=/dev/block/mmcblk0pX of=/sdcard/recovery.img
(Where X is the number of your recovery partition)

您可以使用以下命令查找恢复分区的编号:

ls -l /dev/block/platform/soc.0/7824900.sdhci/by-name
(Please, note this path may be device specific, but should be similar for all. This one worked for Sony Xperia X Compact device)

然后,正在提取的recovery.img文件,您现在可以再次提取initfs并重新打包