Hi Peter,
please never drop the ML from your replies.
On 15.09.23 05:10, peter john wrote:
> Hi Stefano,
>
> Thank you for information, as mentioned below we could see : is getting
> replaced with = , for example files: ( converted to files = ( so will it
> affect anything ?
No, replacing : with = is not the real problem. In fact, the file you
generated is correct and can be interpreted by SWUpdate.
When I run:
jsonlibconfig --target json --pretty --file sw-description
I get this one:
{
"software": {
"version": "0.1.0",
"description": "Firmware update for XXXXX Project",
"hardware-compatibility": [
"1.0"
],
"images": [
{
"filename": "rootfs.ubifs",
"volume": "rootfs"
},
{
"filename": "swupdate.ext3.gz.u-boot",
"volume": "fs_recovery"
},
{
"filename": "sdcard.ext3.gz",
"device": "/dev/mmcblk0p1",
"compressed": "zlib"
}
],
"files": {
"filename": "README",
"path": "/README",
"device": "/dev/mmcblk0p1",
"filesystem": "vfat"
},
"scripts": [
{
"filename": "erase_at_end",
"type": "lua"
},
{
"filename": "display_info",
"type": "lua"
}
]
}
}
the problem is for files:
"files": {
"filename": "README",
"path": "/README",
"device": "/dev/mmcblk0p1",
"filesystem": "vfat"
},
This should be an array, the jsonlibconfig tool finds that it is an
array of just an element and switches to scalar, but this cannot be
interpreted by SWUpdate.
By the way, SWUpdate can parse directly a JSON file, why do you need to
convert it ? I just use the jsonlibconfig tool to test both parsers.
So the converted JSON above does not work, but just fixing the array
issue with:
{
"software": {
"version": "0.1.0",
"description": "Firmware update for XXXXX Project",
"hardware-compatibility": [
"1.0"
],
"images": [
{
"filename": "rootfs.ubifs",
"volume": "rootfs"
},
{
"filename": "swupdate.ext3.gz.u-boot",
"volume": "fs_recovery"
},
{
"filename": "sdcard.ext3.gz",
"device": "/dev/mmcblk0p1",
"compressed": "zlib"
}
],
"files": [
{
"filename": "README",
"path": "/README",
"device": "/dev/mmcblk0p1",
"filesystem": "vfat"
}],
"scripts": [
{
"filename": "erase_at_end",
"type": "lua"
},
{
"filename": "display_info",
"type": "lua"
}
]
}
}
It works directly into SWUpdate without any need of conversion. SWUpdate
runs the parser in sequence, and you will just see:
[ERROR] : SWUPDATE failed [0] ERROR parser.c : parse_cfg : 979 :
/tmp/sw-description:1 - syntax error
Because liconfig parser stops with error (of course), but then the JSON
parser is called and it succeed.
Best regards,
Stefano Babic
>
> Thank You.
>
>
>
>
>
> On Thu, 14 Sept, 2023, 8:55 pm Stefano Babic,
> <mailto:
swupdate%2Bunsu...@googlegroups.com>
> > <mailto:
swupdate+u...@googlegroups.com
> <mailto:
swupdate%2Bunsu...@googlegroups.com>>.
> > To view this discussion on the web visit
> >
>
https://groups.google.com/d/msgid/swupdate/CAOn_YWj4%2BcaXUeCF0HeHwyrmvu9DYDj0LY6AKXiGXFRZNWchdg%40mail.gmail.com <
https://groups.google.com/d/msgid/swupdate/CAOn_YWj4%2BcaXUeCF0HeHwyrmvu9DYDj0LY6AKXiGXFRZNWchdg%40mail.gmail.com> <
https://groups.google.com/d/msgid/swupdate/CAOn_YWj4%2BcaXUeCF0HeHwyrmvu9DYDj0LY6AKXiGXFRZNWchdg%40mail.gmail.com?utm_medium=email&utm_source=footer <
https://groups.google.com/d/msgid/swupdate/CAOn_YWj4%2BcaXUeCF0HeHwyrmvu9DYDj0LY6AKXiGXFRZNWchdg%40mail.gmail.com?utm_medium=email&utm_source=footer>>.
>