diff mbox series

[07/13] Export run_prepost_script to other modules

Message ID 20240221082221.11997-8-stefano.babic@swupdate.org
State Accepted
Delegated to: Stefano Babic
Headers show
Series Extend Lua Environemnt and post-failure scripts | expand

Commit Message

Stefano Babic Feb. 21, 2024, 8:22 a.m. UTC
Function is generic and just accept a list of scripts. Export it to let
be called outside the install_images() function.

Signed-off-by: Stefano Babic <stefano.babic@swupdate.org>
---
 core/installer.c    | 2 +-
 include/installer.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

--
2.34.1
diff mbox series

Patch

diff --git a/core/installer.c b/core/installer.c
index 2b85a6e7..f2fbbcab 100644
--- a/core/installer.c
+++ b/core/installer.c
@@ -216,7 +216,7 @@  static int update_swupdate_vars(struct swupdate_cfg *cfg, const char *script)
 	return ret;
 }

-static int run_prepost_scripts(struct imglist *list, script_fn type)
+int run_prepost_scripts(struct imglist *list, script_fn type)
 {
 	int ret;
 	struct img_type *img;
diff --git a/include/installer.h b/include/installer.h
index 613ecc71..aad77097 100644
--- a/include/installer.h
+++ b/include/installer.h
@@ -21,4 +21,5 @@  int install_single_image(struct img_type *img, bool dry_run);
 int install_from_file(const char *filename, bool check);
 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);