swupdate failed to install update from initramfs due to parsing error

391 views
Skip to first unread message

Supriya Jagtap

unread,
Dec 26, 2019, 7:04:34 AM12/26/19
to swupdate
I have successfully setup firmware update mechanism using swupdate and double partition strategy. Now, I am trying to implement single partition update mechanism. I am using raspbian-lite(stretch). Using hook-script (ie. copy_exec), I have copied swupdate binary to the initramfs (for testing purpose). All dependencies are in place. I have compiled swupdate binary with both CONFIG_ARCHIVE and CONFIG_JSON support, and tested the same with both of the sw-description file formats, it works fine.

However, now that I run swupdate from initramfs, getting parsing errors as follows:
software set: stable mode: main
[ERROR] : SWUPDATE failed [0] ERROR parser/parser.c : parse_hw_compatibility : 191 : HW compatibility not found
[ERROR] : SWUPDATE failed [0] ERROR parser/parser.c : parser : 674 : Found nothing to install
[ERROR] : SWUPDATE failed [0] ERROR parser/parser.c : parse_json : 754 : JSON File corrupted
[ERROR] : SWUPDATE failed [0] ERROR core/parser.c : parse : 195 : no parser available to parse sw-description!
[ERROR] : SWUPDATE failed [0] ERROR corelib/stream_interface.c : extract_files : 156 : Compatible SW not found
[ERROR] : SWUPDATE failed [1] Image invalid or corrupted. Not installing ...

I have both /etc/hwrevision and /etc/sw-versions files in place. In fact this same update archive works fine when triggered from rootfs. sw-description is basically a software-collection and I do pass -e stable,main flag. I am not really sure what am I missing here. 

this is the sw-description file:

 software =
{
    name = "CR-firmware";
    version = "1.5.3";
    CRBox = {
        hardware-compatibility: [ "1.0" ];
        stable : {

                main: {
                        files: (
                        {
                                filename = "test.tar";
                                type = "archive";
                                path = "/usr";
                                create-destination = true;
                                sha256 = "";
                        }
                        );
                };

                alt: {
                        files: (
                        {
                                filename = "test.tar";
                                type = "archive";
                                path = "/usr";
                                create-destination = true;
                                sha256 = "";
                        }
                        );

                };
        };
};
}

/etc/hwrevision -> CRBox 1.0
/etc/sw-versions -> CR-firmware 1.5.1

Initramfs contains Busybox utils. Not sure if I am missing anything in initramfs. Would really appreaciate any help in this regards.

Thanks,
Supriya J
swupdate.log

Supriya Jagtap

unread,
Dec 27, 2019, 1:37:05 AM12/27/19
to swupdate
Turned out to be a spelling mistake in hardware revision name in initramfs :( . Mistakenly added a capital letter. After correcting /etc/hwrevision entry, it worked fine. 

Thanks,
Supriya J

Praful Kabadi

unread,
May 20, 2022, 6:17:26 AM5/20/22
to swupdate
Hi Supriya,

We have been trying to implement the double copy on Raspberry Pi 4 however we have been struggling in implementing the same. Could you please help and guide us with references to implement the same? Could you also show us the source code and post install script that is being used to implement the updation process if possible.

Thank you,
Praful
Reply all
Reply to author
Forward
0 new messages