Hi!
I struggle with the sw-description file: My goal is to have different
bootloader settings for different hardware revisions but for the same
Image.
So, I tried to build a sw-description file reflecting my goal. Based
on the "Using links" example
(
https://sbabic.github.io/swupdate/2024.12/sw-description.html#using-links)
I tried the following sw-description file (variables with @@ are
processed beforehand):
software =
{
version = "@@MAJOR@@.@@MINOR@@.@@PATCH@@.@@BUILDNUMBER@@.@@HASH@@";
@@MACHINE@@ = {
stable = {
hardware-compatibility: [ "1.0", "2.0" ];
rev1: {
hardware-compatibility: [ "1.0" ];
files: (
{
filename =
"@@VAR_SWUPDATE_TARGET_IMAGE_FILE@@";
...
}
);
scripts: (
{
...
}
);
bootenv: (
{
name = "dtbfile";
value = "oldDeviceTree.dtb";
}
);
},
rev2: {
hardware-compatibility: [ "2.0" ];
files: (
{
filename =
"@@VAR_SWUPDATE_TARGET_IMAGE_FILE@@";
...
}
);
scripts: (
{
...
}
);
bootenv: (
{
name = "dtbfile";
value = "newDeviceTree.dtb";
}
);
}
}
}
}
The first error is
> [ERROR] : SWUPDATE failed [0] ERROR parser.c : parse_hw_compatibility : 282 : HW compatibility not found
followed by more errors. The error remains on different variations of
my sw-description file.
My first sw-description file is still working:
software =
{
version = "@@MAJOR@@.@@MINOR@@.@@PATCH@@.@@BUILDNUMBER@@.@@HASH@@";
@@MACHINE@@ = {
hardware-compatibility: [ "1.0" ];
files: (
{
filename = "@@VAR_SWUPDATE_TARGET_IMAGE_FILE@@";
...
}
);
scripts: (
{
...
}
);
};
}
So, I assume my /etc/hwrevision file is correct.
If I call
> swupdate -e stable,rev1 -n -i /dev-50a3df4-20251008123921.swu
the sw-description file is processed fine. If I rely on
/etc/hwrevision I get the error mentioned above.
Can anyone give me a hint how a sw-description file must look like to
have different bootloader settings for different hardware revisions
based on /etc/hwrevision?
Thanks in advance.
--
h.wulff