[PATCH] core: set image version when using streaming handler

6 views
Skip to first unread message

Mark Deneen

unread,
Nov 4, 2025, 4:49:45 PM (7 days ago) Nov 4
to swup...@googlegroups.com, Mark Deneen
--gen-swversions functionality does not work with streamed images.

This patch address that oversight.

Signed-off-by: Mark Deneen <mde...@gmail.com>
---
core/installer.c | 2 +-
core/stream_interface.c | 3 +++
include/installer.h | 2 ++
3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/core/installer.c b/core/installer.c
index 8cba1790..29d5ed83 100644
--- a/core/installer.c
+++ b/core/installer.c
@@ -310,7 +310,7 @@ int install_single_image(struct img_type *img, bool dry_run)
return ret;
}

-static int update_installed_image_version(struct swver *sw_ver_list,
+int update_installed_image_version(struct swver *sw_ver_list,
struct img_type *img)
{
struct sw_version *swver;
diff --git a/core/stream_interface.c b/core/stream_interface.c
index 8fadde3d..ed6766d8 100644
--- a/core/stream_interface.c
+++ b/core/stream_interface.c
@@ -344,6 +344,9 @@ static int extract_files(int fd, struct swupdate_cfg *software)
ERROR("Error streaming %s", img->fname);
return -1;
}
+
+ update_installed_image_version(&software->installed_sw_list, img);
+
TRACE("END INSTALLING STREAMING");
break;
}
diff --git a/include/installer.h b/include/installer.h
index aad77097..21b3d9f6 100644
--- a/include/installer.h
+++ b/include/installer.h
@@ -23,3 +23,5 @@ int postupdate(struct swupdate_cfg *swcfg, const char *info);
int preupdatecmd(struct swupdate_cfg *swcfg);
int run_prepost_scripts(struct imglist *list, script_fn type);
void cleanup_files(struct swupdate_cfg *software);
+int update_installed_image_version(struct swver *sw_ver_list,
+ struct img_type *img);
--
2.51.0

Reply all
Reply to author
Forward
0 new messages