Passing meta-data via swupdate_async_start

19 views
Skip to first unread message

Sascha Stortz

unread,
Oct 29, 2025, 12:46:19 PM (13 days ago) Oct 29
to swupdate
Hi All,

I would like to know if it is a good idea to transfer a device's metadata, such as its serial number, to the SWUpdate daemon via the IPC method swupdate_async_start using the info field of the swupdate_request structure. 
The goal is to use a Lua handler to check the serial number against a serial number set in the sw-description and to refuse the update if they do not match.

If this is not the best way, is there a recommendation for handling device metadata in SWUpdate Daemon?

Thanks in advance,
cheers Sascha

Stefano Babic

unread,
Oct 29, 2025, 12:59:26 PM (13 days ago) Oct 29
to Sascha Stortz, swupdate
Hi Sascha,
Let's say this is not (yet) supported, at least into Lua. But getting
such as kind of information (called "identify" inside the code) is
already provided for the backend connectors (the suricatta modules).

Because all this data are static and they not change at runtime, the
usual way is to fill the swupdate.cfg. If you take a look at doc, there
is an "identify" section, where the user can add pairs (name value).

identify : (
{ name = "serialNo"; value = "1234567890"; },
);

This is loaded at startup by the modules that have interest, that means
the backend modules, and they forward this information to the deployment
server.

What is missing to your use case is to make this dictionary available as
table for Lua, so that a handler or an embedded-script can be written to
add own logic. And then maybe factorize the whole stuff, so that this
information is read just once.

I won't add this to the IPC, also because I am thinking about to
redesign this soon or later and make it easier. Maybe the IPC just
contain JSON messages, as JSON support is now mandatory in SWUpdate (it
wasn't when IPC was introduced).

Best regards,
Stefano Babic

Sascha Stortz

unread,
Oct 30, 2025, 3:43:17 AM (13 days ago) Oct 30
to swupdate
Hi Stefano,

Thanks for your fast response.
Adding this meta-data in swupdate.cfg is not an option, because this configuration file is generic for many devices and built in Yocto.
In our case, this kind of device data is not known at build time.

It’s good to know that the IPC call with the data in the info section is currently not accessible from a Lua handler.

I will therefore create a Lua file at runtime that contains the device’s meta-data, written by the application.
This file can then be read by a preinstall handler, which works well for our use case.

I’m looking forward to the new feature for passing JSON via IPC in the future.


Best regards,
Sascha

Stefano Babic

unread,
Oct 30, 2025, 4:16:31 AM (13 days ago) Oct 30
to Sascha Stortz, swupdate
Hi Sascha,

On 10/30/25 08:43, 'Sascha Stortz' via swupdate wrote:
> Hi Stefano,
>
> Thanks for your fast response.
> Adding this meta-data in /swupdate.cfg/ is not an option, because this
> configuration file is generic for many devices and built in Yocto.
> In our case, this kind of device data is not known at build time.

This is a common case. The file often contains runtime variable. Zocto
build a template, and at boot time you fill the runtime variables. Each
device has an own file.

>
> It’s good to know that the IPC call with the data in the /info/ section
> is currently not accessible from a Lua handler.
> > I will therefore create a Lua file at runtime that contains the
device’s
> meta-data, written by the application.

See above, this is already solved by creating the configuration file at
runtime.

> This file can then be read by a preinstall handler, which works well for
> our use case.
>
> I’m looking forward to the new feature for passing JSON via IPC in the
> future.
>

Best regards,
Stefano
> --
> 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 visit https://groups.google.com/d/msgid/
> swupdate/a78af562-d73c-449c-a97d-9deb35cb16d2n%40googlegroups.com
> <https://groups.google.com/d/msgid/swupdate/a78af562-d73c-449c-
> a97d-9deb35cb16d2n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages