From 51655b11ddd2581f04c5454dcfa20489afe79c9c Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Wed, 4 Dec 2024 11:23:05 +0100 Subject: [PATCH] swupdate: fix build errors in ubivol rdiff handler patch This patch includes code that only gets compiled for platforms that use a NAND as the internal storage. Recent changes in swupdate's "copyfile" API caused this code to stop building. Using the normal rdiff handler code as reference, update our custom handler to fix the build errors. While at it, include another change to prevent a warning. Signed-off-by: Gabriel Valcazar --- ...andler-for-applying-librsync-s-rdiff.patch | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/meta-digi-dey/recipes-support/swupdate/swupdate/0003-handlers-rdiff-handler-for-applying-librsync-s-rdiff.patch b/meta-digi-dey/recipes-support/swupdate/swupdate/0003-handlers-rdiff-handler-for-applying-librsync-s-rdiff.patch index 8a63cccc6..38c516b98 100644 --- a/meta-digi-dey/recipes-support/swupdate/swupdate/0003-handlers-rdiff-handler-for-applying-librsync-s-rdiff.patch +++ b/meta-digi-dey/recipes-support/swupdate/swupdate/0003-handlers-rdiff-handler-for-applying-librsync-s-rdiff.patch @@ -16,8 +16,8 @@ Signed-off-by: David Escalona configs/all_handlers_defconfig | 1 + handlers/Kconfig | 13 + handlers/Makefile | 1 + - handlers/ubivol_rdiff_handler.c | 606 ++++++++++++++++++++++++++++++++ - 5 files changed, 625 insertions(+) + handlers/ubivol_rdiff_handler.c | 595 ++++++++++++++++++++++++++++++++ + 5 files changed, 614 insertions(+) create mode 100644 handlers/ubivol_rdiff_handler.c diff --git a/Makefile.flags b/Makefile.flags @@ -87,7 +87,7 @@ new file mode 100644 index 0000000..3b6073d --- /dev/null +++ b/handlers/ubivol_rdiff_handler.c -@@ -0,0 +1,606 @@ +@@ -0,0 +1,595 @@ +/* + * Author: Christian Storm + * Copyright (C) 2018, Siemens AG @@ -252,7 +252,7 @@ index 0000000..3b6073d + case RS_RUNNING: strresult = (char*)"RUNNING"; break; + default: break; + } -+ TRACE("%s avail_in=%ld avail_out=%ld result=%s", ++ TRACE("%s avail_in=%zu avail_out=%zu result=%s", + msg, buffers->avail_in, buffers->avail_out, strresult); +} + @@ -657,18 +657,7 @@ index 0000000..3b6073d + rs_trace_to(rdiff_log); + + rdiff_state.job = rs_patch_begin(base_file_read_cb, rdiff_state.base_file); -+ ret = copyfile(img->fdin, -+ &rdiff_state, -+ img->size, -+ (unsigned long *)&img->offset, -+ img->seek, -+ 0, /* no skip */ -+ img->compressed, -+ &img->checksum, -+ img->sha256, -+ img->is_encrypted, -+ img->ivt_ascii, -+ apply_rdiff_chunk_cb); ++ ret = copyimage(&rdiff_state, img, apply_rdiff_chunk_cb); + if (ret != 0) { + ERROR("Error %d running rdiff job, aborting.", ret); + goto cleanup;