new swupdate 2024.05 json/libconfig

223 views
Skip to first unread message

ayoub...@googlemail.com

unread,
Jun 3, 2024, 9:12:00 AM6/3/24
to swupdate
Hi,

after update to new version 2024.05, I get the following error:

Feb 27 17:26:48 stm32mp157f-dk2-e1-8f-12 swupdate[462]: FAILURE ERROR parser.c : parse : 167 : /tmp/sw-description:24 - syntax error
Feb 27 17:26:48 stm32mp157f-dk2-e1-8f-12 swupdate[462]: [ERROR] : SWUPDATE failed [0] ERROR parser.c : parse : 167 : JSON File corrupted
Feb 27 17:26:48 stm32mp157f-dk2-e1-8f-12 swupdate[462]: FAILURE ERROR parser.c : parse : 167 : JSON File corrupted
Feb 27 17:26:48 stm32mp157f-dk2-e1-8f-12 swupdate[462]: [ERROR] : SWUPDATE failed [0] ERROR parser.c : parse : 171 : no parser available to parse sw-description!
Feb 27 17:26:48 stm32mp157f-dk2-e1-8f-12 swupdate[462]: [ERROR] : SWUPDATE failed [0] ERROR stream_interface.c : extract_files : 182 : Compatible SW not found
Feb 27 17:26:48 stm32mp157f-dk2-e1-8f-12 swupdate[462]: [ERROR] : SWUPDATE failed [1] Image invalid or corrupted. Not installing ...
Feb 27 17:26:48 stm32mp157f-dk2-e1-8f-12 swupdate[462]: [ERROR] : SWUPDATE failed [0] ERROR mongoose_interface.c : upload_handler : 637 : Writing to IPC fails due to Broken pipe
Feb 27 17:26:48 stm32mp157f-dk2-e1-8f-12 swupdate[462]: FAILURE ERROR parser.c : parse : 171 : no parser available to parse sw-description!
Feb 27 17:26:48 stm32mp157f-dk2-e1-8f-12 swupdate[462]: FAILURE ERROR stream_interface.c : extract_files : 182 : Compatible SW not found
Feb 27 17:26:48 stm32mp157f-dk2-e1-8f-12 swupdate[462]: FAILURE ERROR mongoose_interface.c : upload_handler : 637 : Writing to IPC fails due to Broken pipe
Feb 27 17:26:48 stm32mp157f-dk2-e1-8f-12 swupdate[462]: [ERROR] : SWUPDATE failed [0] ERROR parser.c : parse : 167 : /tmp/sw-description:24 - syntax error
Feb 27 17:26:48 stm32mp157f-dk2-e1-8f-12 swupdate[462]: [ERROR] : SWUPDATE failed [0] ERROR parser.c : parse : 167 : JSON File corrupted
Feb 27 17:26:48 stm32mp157f-dk2-e1-8f-12 swupdate[462]: [ERROR] : SWUPDATE failed [0] ERROR parser.c : parse : 171 : no parser available to parse sw-description!
Feb 27 17:26:48 stm32mp157f-dk2-e1-8f-12 swupdate[462]: [ERROR] : SWUPDATE failed [0] ERROR stream_interface.c : extract_files : 182 : Compatible SW not found
Feb 27 17:26:48 stm32mp157f-dk2-e1-8f-12 swupdate[462]: [ERROR] : SWUPDATE failed [1] Image invalid or corrupted. Not installing ...
Feb 27 17:26:48 stm32mp157f-dk2-e1-8f-12 swupdate[462]: FAILURE ERROR parser.c : 


My sw-description is in libconfig format and CONFIG_LIBCONFIG=y is set I'm wondering why swupdate is trying to enforce json parsing format for sw-description  ?


Stefano Babic

unread,
Jun 3, 2024, 9:24:13 AM6/3/24
to ayoub...@googlemail.com, swupdate
Hi Ayoub,
Because:

parser.c : parse : 167 : /tmp/sw-description:24 - syntax error

You have a wrong sw-description and it cannot be parsed with libconfig,
then SWUpdate tries with next parser. This has nothing to do with the
update to 2024.05.

Best regards,
Stefano

ayoub...@googlemail.com

unread,
Jun 3, 2024, 10:02:55 AM6/3/24
to swupdate
Hi Stefano,

I'm using the same sw-description since long time :

software =
{
        version = "0.5.0-rc2-10-gda52265";

embedded-script = "

function set_active_system(image)
active_system = swupdate.get_bootenv('active_system')
print(\"active_system:\" .. tostring(active_system))
if active_system == \"A\" then
image.version= \"B\"
else
image.version= \"A\"
end
swupdate.trace(\"image.version: \" .. image.version)
return true, image
end
"
"

images:  (
{
name = "rootfs";
version = "0.5.0-rc2-10-gda52265";
filename = "ozyx-image-qtdemo.ext4.dmverity.gz";
device = "/dev/update";
compressed=true;
type = "raw";
installed-directly=true;
encrypted = true;
sha256 = "4c571417fe6406455382a57db8156fd37caaa1e689feb084f8c3fab06fa49d36";
}
);

bootenv: (
{
name = "active_system";
value = "X"; //dummy;
hook = "set_active_system";
}
);
}

parser.c : parse : 167 : /tmp/sw-description:24 - syntax error should be here, version = "0.5.0-rc2-10-gda52265"; what is wrong with it ? is a new format required for version ?

best regards

Stefano Babic

unread,
Jun 3, 2024, 10:10:18 AM6/3/24
to ayoub...@googlemail.com, swupdate
On 03.06.24 16:02, 'ayoub...@googlemail.com' via swupdate wrote:
> Hi Stefano,
>
> I'm using the same sw-description since long time :
>
> software =
> {
>         version = "0.5.0-rc2-10-gda52265";
>
> embedded-script = "
>
> function set_active_system(image)
> active_system = swupdate.get_bootenv('active_system')
> print(\"active_system:\" .. tostring(active_system))
> if active_system == \"A\" then
> image.version= \"B\"
> else
> image.version= \"A\"
> end
> swupdate.trace(\"image.version: \" .. image.version)
> return true, image
> end
> "
> "


With twice double quote ?
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swupdate+u...@googlegroups.com
> <mailto:swupdate+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/swupdate/43f4b800-9b43-43b6-9885-4aa6f048f084n%40googlegroups.com <https://groups.google.com/d/msgid/swupdate/43f4b800-9b43-43b6-9885-4aa6f048f084n%40googlegroups.com?utm_medium=email&utm_source=footer>.

ayoub...@googlemail.com

unread,
Jun 3, 2024, 10:28:41 AM6/3/24
to swupdate
Thanks Stefano, It works now :-) I was mislead by the line number.
Reply all
Reply to author
Forward
0 new messages