From patchwork Wed Jul 3 13:08:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1956229 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=tTs7VDgx; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::240; helo=mail-lj1-x240.google.com; envelope-from=swupdate+bncbd2zdgn6sekrbrm2sw2amgqekojeqky@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-lj1-x240.google.com (mail-lj1-x240.google.com [IPv6:2a00:1450:4864:20::240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WDg7t6NL6z1xqb for ; Wed, 3 Jul 2024 23:08:26 +1000 (AEST) Received: by mail-lj1-x240.google.com with SMTP id 38308e7fff4ca-2ec4efbbb7asf47562051fa.2 for ; Wed, 03 Jul 2024 06:08:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720012103; cv=pass; d=google.com; s=arc-20160816; b=KqUrO8y8FavEMXLnbSFe0akhWIxkCA1o412leh9EA1muza9g4I+fXtzCFOcIiL3+/I NSEV5bTjIgR0YKrJNLljzCxI2vr6SrNXTuZX/mwtdD5Q00xw+LkOwD0Idl2eewXIJWf9 CLNfJM0xHwJEYKzkegveZ2D+CFK7HkCmgRoD1klRoyIJzKRM9IKCrANVC4gz16WKhQz5 UzxhQ/DII7IQHbudvFlswiEUWK/wkp5RiKuS9YAOxE7Mz/RwPN2jZPj3S+omuHDdPrLM dL5eaGpbcGXppyxYKti9PpnQIGdosrb5nkAKxgeRYhSy57/234e62ffTzp/GCJa1QfOl jNAA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:ui-outboundreport:mime-version :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=N7CYI55B5JaK/F+oytaka0iudUqSPuaqpQaOmyvuRO8=; fh=llcxzUlj6BWAMMnWHs77QRtmlwASlWTM3qCcAiF7pcs=; b=EiYDSrKYLGUuPx/+j00HS9ig7Jo3gZuTBBSo8HlfJPC8PhCeHQ4J4JxWAhjrhEKss+ I/U5FpC/VEo8gwvfR5HJh5mWC90Sph8dfF59hiUnYH0Gpciaole77XCQSYazscXfefot OsmgabKGkl+wtHseEx+G2N1yPp0tSQp9m7K6Se8Q6jDunOWjI+ln0w4A9/G+3nMzHr+9 GyToazqaSGyDGqdNgA7QVQzMpIEOqE4AtEo2jPIh71iiO9L/dhPRZiVxub5ncYXsO26Y 1AQ+GvpkmR9Yhl56t+yxsqN22jnrkuTqFGDv8v/mPdBTBVO17tJ2LgPamHqiWMIxIuPQ 0tEQ==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=H2n2SBO1; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.74 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1720012103; x=1720616903; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:ui-outboundreport:mime-version:message-id:date :subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=N7CYI55B5JaK/F+oytaka0iudUqSPuaqpQaOmyvuRO8=; b=tTs7VDgxMWDxo57mrjsTjrLZZUG96qZcunHlkrOtsvS67lR87CAvZfQ2b/eJP+77xq TM/oKbmGTLGzeNkwNWFGXZTajnQo5Io2guuaNqY9UDpaYYn1kivSwJmwdUv/PHcVc7vp 9ykMB+ojwyoMdrxoptU7tGZmxZCCpgMbrV3DmJ7kzlbp/OuzaExe4zzQ89YYWGZYLeCz /yKNbCAHLtRxWYiwaOle6R5UnAUclbhiLduAsSycPSOera2PDuqFUQB4FrfeEvR4IsIb x7sjx9tbKVsqmRQtOHIeDCaXsn8vv4yr/F1Y/Uw9wVhg7hPYmUiWu2mnrPRTL6X4ujw+ rRdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720012103; x=1720616903; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :ui-outboundreport:mime-version:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=N7CYI55B5JaK/F+oytaka0iudUqSPuaqpQaOmyvuRO8=; b=KG5/f649Lf/pMbEbE7HmLhs3Jup/djrw+WuGZAKJEBaJmR/IcvJQ1UyYgrHnq9hjtO XNs0pn4mSM+Rhe2iPecPEXQG+zQQ5zi4Bb981/dXnxaNDFcpQNfrWxoR3WU61RKduy2A ur76ubKCwFuwkvVDn2AQLF2Ulg9hU0Ol0SvNb+RmFACLsbXesWb22h/sa1fJtIsKhNqd zO1GjrekCTih8QU+0h1W/O3q4f89e4P6B5YIcmbu0OZ97zdQrUPs5k/R7vp1T7fWphba YYHLw0JtE4h8Wg0Y481fag+yKp7O68UI5hjxQ8GxzRMzhFJqAUxJJI9rxq4a4XBnuRyo xM/A== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCUy5aSZrnLhqwaoXB40G6+Qmtjl43x+LcowQ5EnLIAviB9FpVJUYAH5pd1YVvnfOHpdNkB6wPoflaH6HvRJ1qoRLJbelKKWA3Mk7IH/Rg== X-Gm-Message-State: AOJu0Yz/6LBTlRdjE8L90omHswxdfoAfCmQj2h0ZmLW7xkvKDROQ4wkR bUN29erycrLMgwP+vIb28h2XJ9r9EgewcBPgXoCK4HPBZZlkowuV X-Google-Smtp-Source: AGHT+IHLf6bZV6A3bQD3hasBLEuY5BPDTbiAQLp9w5HnDRkmJIdr/OJ83bCRESgLFNVRlJ9HaRjWvQ== X-Received: by 2002:a2e:bc88:0:b0:2ee:7a54:3b14 with SMTP id 38308e7fff4ca-2ee7a543b8dmr34466581fa.7.1720012102543; Wed, 03 Jul 2024 06:08:22 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:600c:4fd4:b0:421:7d7f:c621 with SMTP id 5b1f17b1804b1-4256bbf3f9fls30043535e9.1.-pod-prod-05-eu; Wed, 03 Jul 2024 06:08:19 -0700 (PDT) X-Received: by 2002:adf:f390:0:b0:366:f74f:abf0 with SMTP id ffacd0b85a97d-367756a8316mr8169525f8f.16.1720012099510; Wed, 03 Jul 2024 06:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720012099; cv=none; d=google.com; s=arc-20160816; b=rkYcN449tNJM4ub2TPqgAzKYBMlevHmJFvolusiQCHcZ5EXz2Gk9ET3hJafljplg2X 7POpQPyQucfJa3ZGHCp1IoYo0uRBISXKAIbrbLgUmSruorM6OKe+qBent1Mq53K0Nlsd 5WmRgQ64RhoyGj6XzSGkdq6wzcOhmxuvGv3Q6Uev2nC3SGGIEnMtkBTkAaAIqu15gD2I FqWTRaJGYN6OYJoKPmt3JGwQUqt2uvdB2v4+ywtv9v91z7avh5sa5fP8dzsG0sbGREoU ylkyxBNuxnBwTO/j0WwuQ+0eaR4crMOibeEdCxV4nKQMn+Hz9BOMJ4uT5aFLs3djRsvO gedQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version:message-id :date:subject:cc:to:from:dkim-signature; bh=cF50qscH7HAK/G3c0df3duwhpQcVmkaUMxLKp75r+Z8=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=A1iq7hn2kT5cQhg9M8AGhjfijdCB5kBD6m2TQcowpJotK5OG2AjDVeq2nBKMW3YB/F UspqVdZsx+x0urSgXl1Kt7Z195jHthXd+aVmuEgbXTU52bA/OXiGj8wxCHKGosFPx6Cj 1BMb/c9E1PFjj5B/gBCK39WMifAaL03Y6eQRmRXO3QOUm+BegsJ4ZRbohnv9dVWQ+1J9 pW5KpVS6EV3EV6e04dmW0mqv17gjJXM5KJrt77XvwWi5OcqFxNoCyKqBINb9fXrkY97L X9OzRGhB0wD7QmSjrwGDy9yF7oAkVoY4YoOZADyH6A7TdWpfAeCPf1g8gC/GjjcXIfd1 SAOw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=H2n2SBO1; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.74 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [217.72.192.74]) by gmr-mx.google.com with ESMTPS id ffacd0b85a97d-3675a0cb62dsi211372f8f.1.2024.07.03.06.08.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 06:08:19 -0700 (PDT) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.74 as permitted sender) client-ip=217.72.192.74; X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from paperino.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue107 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MD9CZ-1sXYJ945bt-003Esc; Wed, 03 Jul 2024 15:08:19 +0200 From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH] Lua: do not inject again bootenv for handlers Date: Wed, 3 Jul 2024 15:08:16 +0200 Message-Id: <20240703130816.433514-1-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:bHuXhig9I5V+rLZVEokKvvZ+EEGSkaZbwRMky8Fb1ezZhrgaxnD Cmb3YFLneN4jjtjMrWI7+E5ri2xcsUzjnwj0MrVoSz8yh59mUOIAPI4wBdpW27r0S/NRQBz +YW3K3l4hsZ31/EInssLpsYAfV6eGPKC13pzpGkFkt773wZwttkdyXqRXxJpSJCnr6mnduw XUT/EUrdoRn4kqeLozOeQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:QJO/3mYe6js=;/1aeIQhLl830iOATNfYs+XFI9xb DhAT3TUAt3/g5UWPkPSDp4D9l3zZioZn4pfcSM+/C0KPOzAakSkOZyfx+Ah/3OokiNbsew8O5 Dv7O7jxvoLxi5lMAJZZXJakBx6QdyjnTGxB/R+j1p9cxriuFMh/ia6gXt7e/tobvDl9YFv83Q YVbRHSNqycz19QU9wraWL+Gy8/H1LEp7uAI2gULiX7/vz5beL8U2bC0VC00xWQfRvRCV0aQUv jaYaO9ovu+SvRg584aIX01pUvaqj9Ia5Q4x1OnnDFmTYarbUvIl/T1Xy2gU9S8LalSNmQ3fny DY+qdNJr5+jYaCWBmCUhkBigbSxdv7GssIUxHUiAyEnLOtng8WV+NQnvkAWgN+ByHu/C6sK74 YVkXuYqC/likj+fEyUUmDMxeK/h0fxLQqjLUSCbKR7aC59cCZyHFI/yJYmOnUw97S4j9czlkM tldKykMl2ivzDoUVI48NLJ/9Oi+oj69qV0kzkiyP3CdG6cznzPgqSYQqjxo7E8Ar1n+TYDdeT fTi26tbQ25lHSGHaI0CRF16qqyCKBMm3gb30YAYeipOkb3Cdny884Vza18x+11IAqvfNE6DiQ 81AFxVmqEUtcjhXXhETAjYfc8ynuiJ1c0w/BwTaEafKw9nyRRNvpJrB0Y2fBWKBsPhKcai09Z jeDmAMsyyuIv+sW9bpaBP3HYjLwISfLtj31hDMgCho5Zj9fyGMudXhtJ4Qep24lxrwVexSxd9 iZZicaT4/Ucjb6w1LIyoDjNHttBQ3eMO16fbyCcvHu1NxT/AmWXQbc= X-Original-Sender: stefano.babic@swupdate.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=H2n2SBO1; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.74 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Boot environment is pushed to Lua stack to let it available to Lua handlers. After moving Lua state to be per session and added the environment whe nthe session is initialized, there is no need to do this another time. Signed-off-by: Stefano Babic --- corelib/lua_interface.c | 11 ----------- 1 file changed, 11 deletions(-) -- 2.34.1 diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c index 86c2112d..ffa3af8c 100644 --- a/corelib/lua_interface.c +++ b/corelib/lua_interface.c @@ -1307,17 +1307,6 @@ static int l_handler_wrapper(struct img_type *img, void *data, return -1; } - if (img->bootloader) { - lua_getglobal(L, "swupdate"); - if (!lua_istable(L, -1)) { - ERROR("Lua stack corrupted."); - return -1; - } - struct dict **udbootenv = lua_newuserdata(L, sizeof(struct dict*)); - *udbootenv = img->bootloader; - lua_pop(L, 1); - } - l_func_ref = *((int*)data); /* get the callback function */ lua_rawgeti(L, LUA_REGISTRYINDEX, l_func_ref );