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