HI All :
在调试我们imx6D Android6.0产品OTA升级的时候遇到一个问题,希望您帮忙协助分析下。
现在我们的板子是通过SD卡启动,系统运行正常。
操作如下:
我通过Make dist生成update.zip放到/cache/目录。adb 终端下新建/cache/recovery/command 并写入--update_package=/cache/update.zip参数,然后adb reboot recovery重启。
Log显示升级步骤已经走完并重启,但是uboot走完之后提示Boot image被损坏,通过检查发现SD卡放置boot.img的分区被损坏了,我重新在ubuntu上面格式化sd block1 重新拷贝boot.img就可以启动。
log如下:
random: nonblocking pool is initialized
zeroing 4605 blocks
erasing 86210 blocks
wrote 92979 blocks; expected 88374
max alloc needed was 4096
deleting stash 0646af4f9f5c78f6e710042f282c26bc921af14e
Verifying the updated system image...
Verified the updated system image.
script succeeded
install sucess.
should reboot.
should reboot 1.
after = 1, status = 0 , sideload_auto_reboot = 0,ui->IsTextVisible = 1
should reboot 2.
after = 1
Rebooting...
sysrq: SysRq : Emergency Remount R/O
Emergency Remount complete
reboot: Restarting system with command ''
U-Boot 2015.04-dirty (Jan 31 2018 - 15:41:21)
CPU: Freescale i.MX6DL rev1.3 at 792 MHz
CPU: Temperature 47 C
Reset cause: WDOG
Board: i.MX6-Q1712
I2C: ready
DRAM: 1 GiB
PMIC: PFUZE100 ID=0x10
MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
No panel detected: default to Hannstar-XGA
Display: Hannstar-XGA (1024x768)
In: serial
Out: serial
Err: serial
check_and_clean: reg 0, flag_set 0
Fastboot: Normal
flash target is MMC:0
Net: Phy 1 not found
PHY reset timed out
FEC [PRIME]
Error: FEC address not set.
Normal Boot
Hit any key to stop autoboot: 0
** Unrecognized filesystem type **
boota 12000000
boota: bad boot image magic
=> mmc list
FSL_SDHC: 0 (SD)
FSL_SDHC: 1
FSL_SDHC: 2
=>
通过分析update-script发现升级boot.img的命令只有
package_extract_file("boot.img", "/dev/block/mmcblk1p1");这一处,对应recovery/updater/install.c函数也没有报错出来,
是我哪里有疏忽还是操作流程有问题?
麻烦帮忙分析下,多谢
pls refer to the document as below, hope helpful for you
Dear Joan:
多谢回复。
我是按照链接上的方法做的,现在的问题是recovery在执行update-script脚本的时候,升级没有报错,重启之后发现Boot分区被损坏。
log显示脚本执行成功了的。
bootable/recovery.cpp main函数 1094行我做了如下改动让系统自动重启
ui->Print("should reboot 1.\n");
Device::BuiltinAction after = shutdown_after ? Device::SHUTDOWN : Device::REBOOT;
ui->Print("after = %d, status = %d , sideload_auto_reboot = %d,ui->IsTextVisible = %d \n" ,after,status,sideload_auto_reboot,ui->IsTextVisible());
if ((status != INSTALL_SUCCESS && !sideload_auto_reboot) || ui->IsTextVisible()) {
#if 0
Device::BuiltinAction temp = prompt_and_wait(device, status);
if (temp != Device::NO_ACTION) {
after = temp;
}
#endif
after = Device::REBOOT;
}
如果不强制赋值after=REBOOT,recovery模式升级会一直卡在这里等待
因为我是通过SD卡启动开发板的,怀疑是recovery模式没有识别boot分区或者执行
update-script脚本package_extract_file("boot.img", "/dev/block/mmcblk1p1"); 的时候毁坏了boot分区