0

我正在使用 SWUpdate 使用 A+B(双拷贝)方案为我的 Avnger96 板安装更新。我正在将 SWUpdate 与 Yocto 集成。但是在使用命令行参数在本地安装更新时,安装失败并出现错误:

尝试使用 CLI 进行更新swupdate -H dh-stm32mp1-dhcor-avenger96:1.0 -e stable,copy2 -v -i /tmp/avenger96-swu-v1-dh-stm32mp1-dhcor-avenger96-20220222133501.swu -k /etc/swupdate/swupdate-public.pem

[INFO ] : SWUPDATE started :  Software Update started !
[TRACE] : SWUPDATE running :  [network_initializer] : Software update started
[TRACE] : SWUPDATE running :  [extract_file_to_tmp] : Found file
[TRACE] : SWUPDATE running :  [extract_file_to_tmp] :   filename sw-description
[TRACE] : SWUPDATE running :  [extract_file_to_tmp] :   size 1716
[TRACE] : SWUPDATE running :  [extract_file_to_tmp] : Found file
[TRACE] : SWUPDATE running :  [extract_file_to_tmp] :   filename sw-description.sig
[TRACE] : SWUPDATE running :  [extract_file_to_tmp] :   size 256
[TRACE] : SWUPDATE running :  [swupdate_verify_file] : Verify signed image: Read 1716 bytes
[TRACE] : SWUPDATE running :  [swupdate_verify_file] : Verified OK
[TRACE] : SWUPDATE running :  [get_common_fields] : Version 0.1.0
[TRACE] : SWUPDATE running :  [parse_hw_compatibility] : Accepted Hw Revision : 1.0
[TRACE] : SWUPDATE running :  [_parse_images] : Found compressed Image: core-image-minimal-dh-stm32mp1-dhcor-avenger96.ext4.gz in device : /dev/mmcblk0p5 for handler raw
[TRACE] : SWUPDATE running :  [_parse_bootloader] : Bootloader var: rootfspart = 5
[TRACE] : SWUPDATE running :  [check_hw_compatibility] : Hardware dh-stm32mp1-dhcor-avenger96 Revision: 1.0
[TRACE] : SWUPDATE running :  [check_hw_compatibility] : Hardware compatibility verified
[TRACE] : SWUPDATE running :  [extract_files] : Found file
[TRACE] : SWUPDATE running :  [extract_files] :         filename core-image-minimal-dh-stm32mp1-dhcor-avenger96.ext4.gz
[TRACE] : SWUPDATE running :  [extract_files] :         size 232476044 required
[ERROR] : SWUPDATE failed [0] ERROR : HASH mismatch : 24e9e0e03c5f6efbeb20c6b5da53841c04b9580e8409fa11d5f6307886127576 <--> 4ac608927345a1cdb725f018e20ce54c2840b1012917dffafdc85fe95dc26b14
[ERROR] : SWUPDATE failed [1] Image invalid or corrupted. Not installing ...
[TRACE] : SWUPDATE running :  [network_initializer] : Main thread sleep again !
[INFO ] : No SWUPDATE running :  Waiting for requests...
[INFO ] : SWUPDATE running :  [endupdate] : Swupdate *failed* !

sw-description如下:

software =
{
    version = "0.1.0";

    dh-stm32mp1-dhcor-avenger96 = {
    hardware-compatibility: ["1.0"];
        stable : {
            copy1 : {
                images: ({
                        filename = "core-image-minimal-dh-stm32mp1-dhcor-avenger96.ext4.gz";
                        sha256 = "@core-image-minimal-dh-stm32mp1-dhcor-avenger96.ext4.gz";
                        type = "raw";
                        compressed = "zlib";
                        device = "/dev/mmcblk0p4";
                });
                bootenv: (
                {
                    name = "rootfspart";
                    value = "4";
                },
                );
            };
            copy2 : {
                images: ({
                        filename = "core-image-minimal-dh-stm32mp1-dhcor-avenger96.ext4.gz";
                        sha256 = "@core-image-minimal-dh-stm32mp1-dhcor-avenger96.ext4.gz";
                        type = "raw";
                        compressed = "zlib";
                        device = "/dev/mmcblk0p5";
                });
                bootenv: (
                {
                    name = "rootfspart";
                    value = "5";
                },
                );
            };
        };
    }
}

我在 menuconfig 中设置了“启用签名图像验证”。

SWUpdate menuconfig

我还有一个关于在我的设备上安装的 rootfs 的问题。目前设备是用 启动的/dev/mmcblk0p4,但我可以看到在 linux 用户空间rootfsB中也安装了(/dev/mmcblk0p5)。我正在使用.wksYocto 的文件来构建双分区方案。

.
.
part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root_A --part-name "rootfs_A" --align 4096 --use-uuid --active
part /rootfsB --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root_B --part-name "rootfs_B" --align 4096 --use-uuid

bootloader --ptable gpt

我不确定为什么会发生这种情况,这是预期的行为吗?

谁能告诉我关于 SWUpdate 的问题以及如何解决它?

您的帮助将不胜感激。

提前致谢。

PS:如果这里缺少任何信息,请告诉我。

4

0 回答 0