Embedded LUA script

118 views
Skip to first unread message

Matt Wood

unread,
Mar 27, 2024, 10:26:51 AM3/27/24
to swupdate
Hi all,

I'm implementing an embedded LUA script in a sw-description file. For testing I'm just using a script based on the example to dump the image table. What I need from the data is image version attribute but it is being returned as nil. Does anyone know why and how to fix this?

Thanks, Matt.

function getImageAttrs(image)
for k,l in pairs(image) do
swupdate.trace(\"image[\" .. tostring(k) .. \"] = \" .. tostring(l))
end
return true, image
end

images: ({
filename = "image-name-machine.squashfs";
type = "flash";
sha256 = "$swupdate_get_sha256(image-name-machine.squashfs)";
device = "/dev/mtd1";
name = "Application";
version = "1.0.0";
hook = "getImageAttrs"
install-if-higher = true;
/*installed-directly = true;*/
});

[TRACE] : SWUPDATE running : [parser] : Found Lua Software:
[TRACE] : SWUPDATE running : [parse_hw_compatibility] : Accepted Hw Revision : 1.0
[WARN ] : SWUPDATE running : [check_field_string] : Configuration Key is empty!
[TRACE] : SWUPDATE running : [lua_parser_fn] : Prepared to run getImageAttrs
[TRACE] : SWUPDATE running : [notify_helper] : image[filename] = image-name-machine.squashfs
[TRACE] : SWUPDATE running : [notify_helper] : image[path] =
[TRACE] : SWUPDATE running : [notify_helper] : image[encrypted] = false
[TRACE] : SWUPDATE running : [notify_helper] : image[install_if_different] = false
[TRACE] : SWUPDATE running : [notify_helper] : image[partition] = false
[TRACE] : SWUPDATE running : [notify_helper] : image[sha256] = 12ed53d0c3e5749e6fed236c088c9476573e5063286fe23d665579af7613c190
[TRACE] : SWUPDATE running : [notify_helper] : image[preserve_attributes] = false
[TRACE] : SWUPDATE running : [notify_helper] : image[install_if_higher] = true
[TRACE] : SWUPDATE running : [notify_helper] : image[name] = Application
[TRACE] : SWUPDATE running : [notify_helper] : image[version] =
[TRACE] : SWUPDATE running : [notify_helper] : image[volume] =
[TRACE] : SWUPDATE running : [notify_helper] : image[properties] = table: 0xb3f11bc8
[TRACE] : SWUPDATE running : [notify_helper] : image[data] =
[TRACE] : SWUPDATE running : [notify_helper] : image[type] = flash
[TRACE] : SWUPDATE running : [notify_helper] : image[compressed] = false
[TRACE] : SWUPDATE running : [notify_helper] : image[checksum] = 0.0
[TRACE] : SWUPDATE running : [notify_helper] : image[skip] = 0.0
[TRACE] : SWUPDATE running : [notify_helper] : image[device] = /dev/mtd1
[TRACE] : SWUPDATE running : [notify_helper] : image[size] = 0.0
[TRACE] : SWUPDATE running : [notify_helper] : image[ivt] =
[TRACE] : SWUPDATE running : [notify_helper] : image[mtdname] =
[TRACE] : SWUPDATE running : [notify_helper] : image[offset] = 0.0
[TRACE] : SWUPDATE running : [notify_helper] : image[script] = false
[TRACE] : SWUPDATE running : [notify_helper] : image[filesystem] =
[TRACE] : SWUPDATE running : [notify_helper] : image[installed_directly] = false

Matt Wood

unread,
Mar 27, 2024, 11:31:41 AM3/27/24
to swupdate
Disregard, it was user error.  The field was indeed empty!

Thanks, Matt.
Reply all
Reply to author
Forward
0 new messages