Delta Handler support in Round Robin Lua handler
Hi @stormc,
I am trying to implement delta update in cip-core image using zhunk. I understand that SWUpdate supports it via the delta handler. I am trying the use Round robin handler to support delta update, but update is failing.
Attaching the update logs here:
[DEBUG] : SWUPDATE running : [create_new_environment] : Created new environment revision 3, starting transaction
[DEBUG] : SWUPDATE running : [create_new_environment] : Reusing already created new environment.
[INFO ] : SWUPDATE running : Installation in progress
[TRACE] : SWUPDATE running : [install_single_image] : Found installer for stream update.delta.zck.header roundrobin
[TRACE] : SWUPDATE running : [notify_helper] : Round Robin Handler: No compiled-in config found, trying /etc/swupdate.handler.ini
[INFO ] : SWUPDATE running : [notify_helper] : Round Robin Handler: Using '/dev/disk/by-partuuid/fedcba98-7654-3210-cafe-5e0710000002' as target via 'delta' handler.
[TRACE] : SWUPDATE running : [lua_dump_table] : properties subtype = image
[TRACE] : SWUPDATE running : [lua_dump_table] : Inserting property subtype = image
[TRACE] : SWUPDATE running : [lua_dump_table] : properties chainhandler = delta
[TRACE] : SWUPDATE running : [lua_dump_table] : Inserting property chainhandler = delta
[TRACE] : SWUPDATE running : [lua_dump_table] : properties url = http://10.112.118.73/artifacts/update.delta.zck
[TRACE] : SWUPDATE running : [lua_dump_table] : Inserting property url = http://10.112.118.73/artifacts/update.delta.zck
[TRACE] : SWUPDATE running : [lua_dump_table] : properties zckloglevel = error
[TRACE] : SWUPDATE running : [lua_dump_table] : Inserting property zckloglevel = error
[ERROR] : SWUPDATE failed [0] ERROR delta_handler.c : delta_retrieve_attributes : 314 : Wrong Attributes in sw-description: url=http://10.112.118.73/artifacts/update.delta.zck source=(null), handler=(null)
[ERROR] : SWUPDATE failed [0] ERROR lua_interface.c : notify_helper : 730 : Round Robin Handler: Error chain-calling 'delta' handler: Executing handler delta failed!
[TRACE] : SWUPDATE running : [l_handler_wrapper] : [Lua handler] returned: 1
[TRACE] : SWUPDATE running : [install_single_image] : Installer for roundrobin not successful !
[ERROR] : SWUPDATE failed [1] Installation failed !
[TRACE] : SWUPDATE running : [network_initializer] : Main thread sleep again !
[INFO ] : No SWUPDATE running : Waiting for requests...
[ERROR] : SWUPDATE failed [0] ERROR install_from_file.c : endupdate : 55 : SWUpdate *failed* !
Attaching the sw-description file used:
software =
{
version = "0.2";
name = "cip software update";
images: ({
filename = "update.delta.zck.header";
device = "C:BOOT0:linux.efi->fedcba98-7654-3210-cafe-5e0710000001,C:BOOT1:linux.efi->fedcba98-7654-3210-cafe-5e0710000002";
type = "roundrobin";
sha256 = "5e2da8f516b6bc271b4506b9009f6d60c917567a93deed97b9813e1681d705e8";
properties: {
url = "http://10.112.118.73/artifacts/update.delta.zck"
subtype = "image";
chainhandler = "delta";
zckloglevel = "error";
};
});
files: ({
filename = "linux.efi";
path = "linux.efi";
type = "roundrobin";
device = "C:BOOT0:linux.efi->BOOT0,C:BOOT1:linux.efi->BOOT1";
filesystem = "vfat";
sha256 = "3c80df04783845b0519fa882d10c8b3bd60b135e8283c148a0f8a9ea4c765a62";
properties: {
subtype = "kernel";
};
});
}
Looking at the swupdate_handlers_roundrobin.lua script, I understand that fixup's for delta handler is currently not supported.
As an initial attempt, i tried to add support for the delta handler in the lua script. I have pushed my changes to a different branch "delta-handler-fixup" Please check and review the following commit: delta-handler-fixup
I have verified delta update using zchunk with the above changes and the udpate using the delta handler is successful.
Please let me know if i have to share a patch or Merge request.
@dinesh-toshiba @kshivanand @zuka0828
Thanks and Regards, Adithya Balakumar