1、目前使用的flash为128M,比较小,使用AB升级方式感觉空间不够,所以使用recovery升级linux
2、添加recovery分区
全志提供的SDK本来是不支持打包recovery分区的,需要修改sys_partition.fex,size也需要修改,否则编译失败
+++ b/configs/evb1/linux-5.4/sys_partition.fex
@@ -71,6 +71,6 @@ size = 252[partition]name = recovery
- size = 23184
- ;downloadfile = "recovery.fex"
+ size = 44032
+ downloadfile = "recovery.fex"user_type = 0x8000
3、编译recovery分区
需要执行swupdate_make_recovery_img编译recovery.img
如果使用./build.sh recovery编译、打包、烧录固件后,OTA升级失败,执行完upgrade_recovery后reboot卡在uboot无法进入kernel
[00.695]line:703 init_clocks
[00.698]drv_disp_init
[00.703]handle_num : 6
request pwm success, pwm7:pwm7:0x2000c00.
[00.714]drv_disp_init finish
[00.812]Loading Environment from SUNXI_FLASH... OK
[00.833]boot_gui_init:start
[00.836]set disp.dev2_output_type fail. using defval=0
4、升级失败
[TRACE] : SWUPDATE running : [scan_ubi_volumes] : mtd3: Volume found : mbr
[TRACE] : SWUPDATE running : [scan_ubi_volumes] : mtd3: Volume found : boot-resource
[TRACE] : SWUPDATE running : [scan_ubi_volumes] : mtd3: Volume found : env
[TRACE] : SWUPDATE running : [scan_ubi_volumes] : mtd3: Volume found : env-redund
[TRACE] : SWUPDATE running : [scan_ubi_volumes] : mtd3: Volume found : boot
[TRACE] : SWUPDATE running : [scan_ubi_volumes] : mtd3: Volume found : rootfs
[TRACE] : SWUPDATE running : [scan_ubi_volumes] : mtd3: Volume found : private
[TRACE] : SWUPDATE running : [scan_ubi_volumes] : mtd3: Volume found : recovery
[TRACE] : SWUPDATE running : [scan_ubi_volumes] : mtd3: Volume found : UDISK
[TRACE] : SWUPDATE running : [install_single_image] : Found installer for stream recovery raw
[ERROR] : SWUPDATE failed [0] ERROR core/cpio_utils.c : copy_write : 97 : cannot write 16384 bytes: Operation not permitted
[TRACE] : SWUPDATE running : [install_single_image] : Installer for raw not successful !
Software updated failed
根本原因:升级包中文件的介质与当前板子的介质不对应,不能操作分区
可以在设备端确认当前介质,执行ll /dev/by-name确认(例:当前为emmc介质,为mmc*,如果为nand ubi介质为ubi* 或 nand*)
打包OTA包时需要根据存储介质添加参数,如
$ swupdate_pack_swu -ubi
5、OTA包不需要包含recovery
固件已经包含recovery系统了,后续不修改的话OTA包可以不用包含recovery分区
需要修改sw-description-ubi和sw-subimgs-ubi.cfg两个文件
sw-subimgs-ubi.cfg:不打包recovery分区
+++ b/t113s2-evb1/swupdate/sw-subimgs-ubi.cfg
@@ -1,6 +1,6 @@swota_file_list=(openwrt/target/t113s2/t113s2-evb1/swupdate/sw-description-ubi:sw-description
-${LICHEE_PLAT_OUT}/recovery.img:recovery
+#${LICHEE_PLAT_OUT}/recovery.img:recovery${LICHEE_PLAT_OUT}/uboot.img:uboot${LICHEE_PLAT_OUT}/boot0.img:boot0${LICHEE_PLAT_OUT}/boot.img:kernel
sw-description-ubi:升级时不检测recovery分区文件
+++ b/t113s2-evb1/swupdate/sw-description-ubi
@@ -9,11 +9,11 @@ software =upgrade_recovery = {/* upgrade recovery */images: (
- {
+ /*{filename = "recovery";volume = "recovery"installed-directly = true;
- },
+ },*/{filename = "uboot";type = "awuboot";