Skip to content

# 6.4. OTA 升级包介绍

## 6.4.1. 升级包结构

    Archive:  all_in_one_full.zip
      Length      Date    Time    Name
    ---------  ---------- -----   ----
         1836  2024-05-27 21:02   gpt.conf
         6666  2024-05-27 21:02   data.json
       524288  2024-05-27 20:59   scp.img
       262144  2024-05-27 20:59   ddrc.img
       262144  2024-05-27 20:59   spl.img
       524288  2024-05-27 20:59   MCU_Cluster0_J6E_Galaxy_V1.0.img
      1835008  2024-05-27 20:59   MCU_Cluster0_J6M_Matrix_asw_V1.0.img
      1310720  2024-05-27 20:59   MCU_Cluster0_J6M_Matrix_V1.0.img
      1310720  2024-05-27 20:59   MCU_Cluster0_J6M_EVM_V1.0.img
      1310720  2024-05-27 20:59   MCU_Cluster0_J6M_Matrix_V1.1.img
      1310720  2024-05-27 20:59   MCU_Cluster0_J6M_SIP_Matrix_V1.0.img
      1310720  2024-05-27 20:59   MCU_Cluster0_J6M_SIP_Matrix_V1.1.img
      1310720  2024-05-27 20:59   MCU_Cluster0_J6M_Matrix_LX_V1.1.img
        10304  2024-05-27 20:59   acore_cfg.img
       319968  2024-05-27 20:59   bl31.img
      1049184  2024-05-27 20:59   optee.img
      1183072  2024-05-27 20:59   uboot.img
         2752  2024-05-27 21:02   vbmeta.img
     62914560  2024-05-27 21:01   boot.img
    1287127040  2024-05-27 21:01   system.img
    314048512  2024-05-27 21:01   basesystem.img
    104857600  2024-05-27 21:01   system_verity.img
       235768  2024-05-27 20:58   ota_process
    ---------                     -------
    1783029454                     23 files

文件 | 描述
gpt.conf | 分区表文件
data.json | OTA 配置文件
*.img | 各分区镜像
ota_process | OTA 烧写程序

## 6.4.2. 升级包类型

在j6x系统中,ota升级包分为系统包和应用包。 - 系统包:根据ota时的升级分区配置可以分为单独flash镜像包、单独块设备(emmc & ufs)镜像包,或者混合类型包。 - 应用包:指app应用镜像包,不依赖于系统包,可以单独升级。

## 6.4.3. OTA 配置文件

OTA 升级包中包含配置文件 data.json 。该文件编译时生成，其中了包含该升级包升级分区、镜像信息。

通用配置

配置 | 类型 | 功能
antirollbackUpdate_host | bool | 写host antirollback
antirollbackUpdate_hsm | bool | 写hsm antirollback
backup_dir | str | HSM备份目录
sys_version | str | 系统软件版本
ab_sync | bool | 使能ab同步功能
nor_sign | bool | Nor Flash镜像签名校验开关
update_partition | arr[str] | 升级分区
partition_info | arr[obj] | 各分区配置

各分区配置（partition_info）

配置 | 类型 | 功能
md5sum | arr[obj] | 各镜像MD5值
md5_scope | arr[obj] | 各镜像MD5校验长度
medium | str | 所在外存介质(nor/emmc)
part_type | str | 分区类型(AB/BAK)
have_anti_ver | bool | 使能/失能该镜像antirollback
upgrade_method | str | 升级方式(image/diff)
imgname | str | 镜像名，其中可以使用${var}来动态引用 /sys/class/boardinfo/var 的内容。其中var可替换为任意/sys/class/boardinfo/下的文件

    {
        "antirollbackUpdate_host": true,
        "antirollbackUpdate_hsm": false,
        "backup_dir": "/tmp/ota/backup",
        "sys_version": "@cfc27c6d0918 debug 20240520-203037",
        "ab_sync": true,
        "update_partition": [
            "scp",
            "ddrc",
            "spl",
            "MCU_Cluster0",
            "acore_cfg",
            "bl31",
            "optee",
            "uboot",
            "vbmeta",
            "boot",
            "system",
            "basesystem",
            "system_verity"
        ],
        "nor_sign": false,
        "partition_info": {
            "scp": {
                "md5sum": {
                    "scp.img": "ca859e6574d2eb96035278b20e0b15e9"
                },
                "md5_scope": {
                    "scp.img": 524288
                },
                "medium": "nor",
                "part_type": "AB",
                "have_anti_ver": null,
                "upgrade_method": "image",
                "imgname": "scp.img"
            },
            "ddrc": {
                "md5sum": {
                    "ddrc.img": "735ffd4688c9e920c561302a48ac2c5c"
                },
                "md5_scope": {
                    "ddrc.img": 262144
                },
                "medium": "nor",
                "part_type": "AB",
                "have_anti_ver": null,
                "upgrade_method": "image",
                "imgname": "ddrc.img"
            },
            "spl": {
                "md5sum": {
                    "spl.img": "f4e603812c33a93d17b1deb11fb14867"
                },
                "md5_scope": {
                    "spl.img": 262144
                },
                "medium": "nor",
                "part_type": "AB",
                "have_anti_ver": null,
                "upgrade_method": "image",
                "imgname": "spl.img"
            },
            "MCU_Cluster0": {
                "md5sum": {
                    "MCU_Cluster0_J6E_Galaxy_V1.0.img": "869fc279850f1ce3954cd20ae1ba90db",
                    "MCU_Cluster0_J6M_Matrix_asw_V1.0.img": "5d116a11f32a0967f088a5e301868b0b",
                    "MCU_Cluster0_J6M_Matrix_V1.0.img": "d2db05267ac1f8702e92265c87d92c8d",
                    "MCU_Cluster0_J6M_EVM_V1.0.img": "34f4728fb7b0ee2582de801d94482c4b",
                    "MCU_Cluster0_J6M_Matrix_V1.1.img": "24b2ea9feaf5d39f50495cc0dc5e7dc6",
                    "MCU_Cluster0_J6M_SIP_Matrix_V1.0.img": "b2cfdc7389f93863a08c87dff16fcc79",
                    "MCU_Cluster0_J6M_SIP_Matrix_V1.1.img": "b2cfdc7389f93863a08c87dff16fcc79",
                    "MCU_Cluster0_J6M_Matrix_LX_V1.1.img": "9237819da021278e80b9a4ddd6932c0e"
                },
                "md5_scope": {
                    "MCU_Cluster0_J6E_Galaxy_V1.0.img": 524288,
                    "MCU_Cluster0_J6M_Matrix_asw_V1.0.img": 1835008,
                    "MCU_Cluster0_J6M_Matrix_V1.0.img": 1310720,
                    "MCU_Cluster0_J6M_EVM_V1.0.img": 1310720,
                    "MCU_Cluster0_J6M_Matrix_V1.1.img": 1310720,
                    "MCU_Cluster0_J6M_SIP_Matrix_V1.0.img": 1310720,
                    "MCU_Cluster0_J6M_SIP_Matrix_V1.1.img": 1310720,
                    "MCU_Cluster0_J6M_Matrix_LX_V1.1.img": 1310720
                },
                "medium": "nor",
                "part_type": "AB",
                "have_anti_ver": null,
                "upgrade_method": "image",
                "imgname": "MCU_Cluster0_${board_name}.img"
            },
            "acore_cfg": {
                "md5sum": {
                    "acore_cfg.img": "0d7a081d50fa46e770194e25fb0bad81"
                },
                "md5_scope": {
                    "acore_cfg.img": 10304
                },
                "medium": "emmc",
                "part_type": "AB",
                "have_anti_ver": null,
                "upgrade_method": "image",
                "imgname": "acore_cfg.img"
            },
            "bl31": {
                "md5sum": {
                    "bl31.img": "e60ae2f131c9ba8ef14e200b27037dc0"
                },
                "md5_scope": {
                    "bl31.img": 319968
                },
                "medium": "emmc",
                "part_type": "AB",
                "have_anti_ver": null,
                "upgrade_method": "image",
                "imgname": "bl31.img"
            },
            "optee": {
                "md5sum": {
                    "optee.img": "37895402c166f7823ee0f3c9126eb448"
                },
                "md5_scope": {
                    "optee.img": 1049184
                },
                "medium": "emmc",
                "part_type": "AB",
                "have_anti_ver": null,
                "upgrade_method": "image",
                "imgname": "optee.img"
            },
            "uboot": {
                "md5sum": {
                    "uboot.img": "97682a004c888a69cab3489738df0d02"
                },
                "md5_scope": {
                    "uboot.img": 1183072
                },
                "medium": "emmc",
                "part_type": "AB",
                "have_anti_ver": null,
                "upgrade_method": "image",
                "imgname": "uboot.img"
            },
            "vbmeta": {
                "md5sum": {
                    "vbmeta.img": "5e032a0faaa0c6669d737231ddbbebd1"
                },
                "md5_scope": {
                    "vbmeta.img": 2752
                },
                "medium": "emmc",
                "part_type": "AB",
                "have_anti_ver": true,
                "upgrade_method": "image",
                "imgname": "vbmeta.img"
            },
            "boot": {
                "md5sum": {
                    "boot.img": "d6b6d0c8a6f68aa8bb050887ab2e763f"
                },
                "md5_scope": {
                    "boot.img": 62914560
                },
                "medium": "emmc",
                "part_type": "AB",
                "have_anti_ver": null,
                "upgrade_method": "image",
                "imgname": "boot.img"
            },
            "system": {
                "md5sum": {
                    "system.img": "e1a907d6060fc4e5c5df9576a0cfbff1"
                },
                "md5_scope": {
                    "system.img": 1287127040
                },
                "medium": "emmc",
                "part_type": "AB",
                "have_anti_ver": null,
                "upgrade_method": "image",
                "imgname": "system.img"
            },
            "basesystem": {
                "md5sum": {
                    "basesystem.img": "ad261a5a380f70c0b2f1cd0b30343e84"
                },
                "md5_scope": {
                    "basesystem.img": 314048512
                },
                "medium": "emmc",
                "part_type": "AB",
                "have_anti_ver": null,
                "upgrade_method": "image",
                "imgname": "basesystem.img"
            },
            "system_verity": {
                "md5sum": {
                    "system_verity.img": "cd2e1b793ecaa97c689710cb5ddaaf8a"
                },
                "md5_scope": {
                    "system_verity.img": 104857600
                },
                "medium": "emmc",
                "part_type": "AB",
                "have_anti_ver": null,
                "upgrade_method": "image",
                "imgname": "system_verity.img"
            }
        }
    }