From patchwork Mon Feb 12 15:28:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Storm, Christian" X-Patchwork-Id: 872102 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:400c:c09::23e; helo=mail-wm0-x23e.google.com; envelope-from=swupdate+bncbdd6bwv65qpbbo7fq3kakgqec3innuq@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="XOBEJ2d0"; dkim-atps=neutral Received: from mail-wm0-x23e.google.com (mail-wm0-x23e.google.com [IPv6:2a00:1450:400c:c09::23e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zg8hv4bSCz9t39 for ; Tue, 13 Feb 2018 02:29:02 +1100 (AEDT) Received: by mail-wm0-x23e.google.com with SMTP id g16sf2493729wmg.6 for ; Mon, 12 Feb 2018 07:29:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1518449340; cv=pass; d=google.com; s=arc-20160816; b=ZY1M3j+0C1RtFiu2CKhHpV0T3JNez3WQFObo38kZkZcAfkwTZqSeecLkxWTGuRc49l F626xeZyuPz9hyhiU2txciuaTmXJ4Ew3tdth1mzRPsSQXThDjWlJjKZADsgAgPvI0nQA qeIyFsGKAdD+snnIuJMUqK8SlLyZj8M58/YWAbZb57Ls50VcYyeQveGUwwSgb4V7AYDY SLYijKLUg9JkUjiLS2mIV4Rd5ioWf/7dlDRNtFBO5opBgbkuHzLSMK23/W0kn+vc1/Cz cyoUJBzduIILWLtqYHdWdX48ultrf6yFvHaDqw5yTW7QYX/JXc6Lrge7UUp7NupV2M6q APgA== 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:message-id:date:subject:cc:to:from :arc-authentication-results:arc-message-signature:mime-version :sender:dkim-signature:arc-authentication-results; bh=ZAvMG680S/hK+VzESQogjUA/NL61HbcdhO2W+paNqfs=; b=PO3KSowxBFVZBh3LRj/HppEjM9JpGB+54X9cQUdIYGgAdq/E9BsYCOYCFM3dYkv93Q uoLDYGE1SYvyneG68wWSfvl0XmJT+nO9dLfxiUrgADcrqmaYjx4ixXfF0ACpn5OWnNVf 6h5cc/aohttMy2opk4k5Xt0/LuKH+ZG4SVt1uWRFg8hk7wUzOv50ybDSbLEY0nxvWC7y B2Ar65nSorVL0oYoJk9QFzCvF/d0ciPgzXlbFmpFTczts4blFIlZmwj3o7vLv7yYHUtJ xUArpktq2xmKN917eCCTC2u6GIwsY8zF/Rz8LmUpSx6DnWGt0hUkwWMZqpI6CtCuZS8/ m7lQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=christian.storm@siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:cc:subject:date:message-id :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=ZAvMG680S/hK+VzESQogjUA/NL61HbcdhO2W+paNqfs=; b=XOBEJ2d0sSyxJxMurFoiPptppuLsDf/KFEH44zQATjbhlafVNbFNaAim6omAaGemJy wbY6PVIDW90Jyl/CnDpqgqyygmRiXu7xyJSmv4swETHCgtds/qTg6BxpyP5BVOdPjxFt szi843dP65/5NRYeLcJQ9rcDZoIXt7JpH77pKLXK3x9tZqrwzO9BTygKcJxwghJ8AY2C ilQUYoO1N4jXTHZ8659xD+DTqh1IJkvUXyoGRuQRVutvR+yubGFCSe3D78ywchRxZ2tD 0ljajOcbaIY1CdAy81/piTi5jAHwwNay4ZZGIBnDjxpS4/KJqyNS0A2kNXeLh56OFXQj 08lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=ZAvMG680S/hK+VzESQogjUA/NL61HbcdhO2W+paNqfs=; b=choIKu/e63KRI9r2C1zWHxwxCKDVJPmteRpypaeqZNism9csGCVRs5bo1Wg3m4iuOS +x/6rl3DXKkFiYsTqc/0p6bFO++bPZOgWQbzu2fGPcTmb92W3jvBWlMrjLaRM9Cxa2CF 5Mhk0+bPT4L0HMCtJ6CGUX3lDKWG/blvm0twZCiIlncKuiRLy1URzTyWpvoFKu8UUnpy b5m11kyvvPyjxDj/HQlCAsVySn78PjHk7WttdD7dpu3LzV/V/blMLGk+eZ9zHLvFXBX6 ey4pyVNGq9Kf0xk0tIJFn87p+uBoKM3WNWfKPLZEifbBf38DiHN9c8cizhe6LmysQOxn DYjw== Sender: swupdate@googlegroups.com X-Gm-Message-State: APf1xPDwNYlt2aXHRArKNVaM/narM9aV4X5P74YpEU5ns8FVVCQtMSjU Z+To43mCHKYRaLaW/SBwW9w= X-Google-Smtp-Source: AH8x224P4yPxbzzHfpkdWM5prl/EVogZM3CgYreCdSMIjgPvwrR1LGWE3YrVnIgbbcj0z2aH5rWkBA== X-Received: by 10.28.153.7 with SMTP id b7mr54373wme.6.1518449340133; Mon, 12 Feb 2018 07:29:00 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.80.190.10 with SMTP id a10ls6477759edi.6.gmail; Mon, 12 Feb 2018 07:28:59 -0800 (PST) X-Received: by 10.80.149.81 with SMTP id v17mr2164297eda.10.1518449339251; Mon, 12 Feb 2018 07:28:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518449339; cv=none; d=google.com; s=arc-20160816; b=gDaUFHp3TcL0BO3Bhx8rB4MWrDwyzwdU1HXtdqXyNFs/b0Qr6QOnTTYtPzYkaTA1B+ 3z9g2yv/o7KFwvQb3ZdPHLV05daSh+553QIBxrz9NMgYv9H4kukeF8K7k1r5fLDzHoB/ T0mg/uACOrjGM9agyK1svk+yeEkWBT+kPFuEFRHpK++v3aR4/d5m1V+xitJQuFb0KpLv ozMrfH7SI1Vn7doj4n7kes8WPfb8rZnEqqkqxs0V1ynoeWw3h65+EaRDa++eE3KzZHXc xCO8ukCm8EIqHfLGEtFOcIKMrZxQv1twXFpVQi1CyOxUh5OU0egC/vQxA/EG8Rqkk1RQ 5mMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=BJtIdAFg8ouQERs3QPoFboNjQmrnRIWrr0I+Acv67/k=; b=TyH/W+oiZVt4/MyD+xBoXwyAe0eRlyV2f7k/0tvNSxp7t79iogjVqRzUcg/Jti9fjF v8QzbFTWALCjzCDA/oKyGVEZGr6F0ejoRWWc6BuhgVydlHbpNY5jRgQ1o0RcGQJHzhYA lxzYIz9lBeD8VAAMcpIudGdLqGnc4hdk5WzrOPaivuj06VimILOCeh/MPKn/1yxx5678 B/DrFe6mTPHt+ZoGUsCf/izvtoF8IM9V5v0w325yT4pfEeBsco7tKfNNoR2XSxwwJfg6 t9/YUjk2v5taNDzXbLgcZY2bqkZIvlQLqUDNL6srg2/YnHu9J6r62TdZtzta+HbVo6ed e3XA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=christian.storm@siemens.com Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id v28si449483edd.3.2018.02.12.07.28.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 07:28:59 -0800 (PST) Received-SPF: pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w1CFSwVc007970 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 12 Feb 2018 16:28:58 +0100 Received: from MD1KR9XC.ww002.siemens.net ([139.25.69.251]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w1CFSw8J017174; Mon, 12 Feb 2018 16:28:58 +0100 From: Christian Storm To: swupdate@googlegroups.com Cc: Christian Storm Subject: [swupdate] [PATCH] Lua: expose get_tmpdirscripts() to Lua Date: Mon, 12 Feb 2018 16:28:35 +0100 Message-Id: <20180212152835.32413-1-christian.storm@siemens.com> X-Mailer: git-send-email 2.16.1 X-Original-Sender: christian.storm@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=christian.storm@siemens.com 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: , In order chain-call the 'bootloader' handler from a Lua handler, get_tmpdirscripts() is needed in the Lua realm as this is the directory where the bootloader handler expects to find its input file. Signed-off-by: Christian Storm Reviewed-by: Stefano Babic --- corelib/lua_interface.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c index 8875026..e96fbe6 100644 --- a/corelib/lua_interface.c +++ b/corelib/lua_interface.c @@ -776,6 +776,12 @@ static int l_get_tmpdir(lua_State *L) lua_pushstring(L, get_tmpdir()); return 1; } + +static int l_get_tmpdir_scripts(lua_State *L) +{ + lua_pushstring(L, get_tmpdirscripts()); + return 1; +} #endif /** @@ -803,6 +809,7 @@ static const luaL_Reg l_swupdate_bootenv[] = { static const luaL_Reg l_swupdate_handler[] = { { "register_handler", l_register_handler }, { "call_handler", l_call_handler }, + { "tmpdirscripts", l_get_tmpdir_scripts }, { "tmpdir", l_get_tmpdir }, { NULL, NULL } };