diff mbox series

[04/13] Store install Lua State in image structure

Message ID 20240221082221.11997-5-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
Each installation will have its own Lua state. Save it into image
structures to allow the handlers to access it.

Signed-off-by: Stefano Babic <stefano.babic@swupdate.org>
---
 parser/parser.c | 1 +
 1 file changed, 1 insertion(+)

--
2.34.1
diff mbox series

Patch

diff --git a/parser/parser.c b/parser/parser.c
index 3944de64..5502e34a 100644
--- a/parser/parser.c
+++ b/parser/parser.c
@@ -384,6 +384,7 @@  static int is_image_higher(struct swver *sw_ver_list,
 static void set_img_globals(struct img_type *img, struct swupdate_cfg *sw)
 {
 	img->bootloader = &sw->bootloader;
+	img->L = sw->lua_state;
 }

 static int run_embscript(parsertype p, void *elem, struct img_type *img,