Message ID | 20191222143604.25057-1-sbabic@denx.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBU777XXQKGQEBZY2HZY@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::23b; helo=mail-lj1-x23b.google.com; envelope-from=swupdate+bncbcxploxj6ikrbu777xxqkgqebzy2hzy@googlegroups.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="d3Rdk4Br"; dkim-atps=neutral Received: from mail-lj1-x23b.google.com (mail-lj1-x23b.google.com [IPv6:2a00:1450:4864:20::23b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47glTS3QQMz9sP6 for <incoming@patchwork.ozlabs.org>; Mon, 23 Dec 2019 01:38:18 +1100 (AEDT) Received: by mail-lj1-x23b.google.com with SMTP id m1sf697839lji.5 for <incoming@patchwork.ozlabs.org>; Sun, 22 Dec 2019 06:38:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1577025492; cv=pass; d=google.com; s=arc-20160816; b=yColJzLDwHHAkTIhYUnmpvklsg7mDgA0uWtSOVSBNcZYjNwP+2VGvp8j+oLUaFnQnA 79LCHfRy2lQr+9bS7NwZiqIewQAnuFOspBJ8uAHqAjnBlDwo3oa7PnevWfs+x6Dv2BUh xvKTMcq6dyurvgaewpnmbOQY9au0GYd7zIYdcls7DeJLLL0vAAXN8zTdD0ChezpRxj03 +HhY1gqL5v2FtxpjibFNyhrq0Mg1FhjVOxP3UEbF8J3YVUnZWdcCysK3UO+t+nGz7yBr zS731XeHx47uTl+YZI5RP0c53K2YyJ1rZEv6U5vmRmvFGvQ/EdjDXvtIqlSOpoUXtNMd YRyw== 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 :mime-version:sender:dkim-signature; bh=ZZYAoAY8tetmQOA8dg0WwzIsMgXeNDk4knAhcKtZO1o=; b=SohTFzk/So53TS4aWdttAUCseKsBd5tqbXhfZrRhSXy1KYnu6+xxNYjDcCa+XY/9za yKeEGHdgpSD4pu2tvJDyPHPBkw0PZJwt9qvdU4FiJlq5VkcF5xNxn9SF/+vto8LinLYj gDxIT8xuOjZJEapUsrF2iUqWuq6XK+vwpGN49/RJmnhwWBSeqH1NUc1NYOlIwT+aHOKT LJT45kISrv4qtn7vhbZ3UCL/UcA/VTkwMeqBUgH05PaaogMrQfeZRQOhl7LCrfFklDF5 PucMD+d0u3udrPi7gC5JoFuYczZyHm9i3VkxWZ91pJrBjQfxBmajCrYSFPAXkx0Kl8CI xgzA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de 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=ZZYAoAY8tetmQOA8dg0WwzIsMgXeNDk4knAhcKtZO1o=; b=d3Rdk4Br4wQ7yUeBWj2LlEzgxf6SG+iDk/ec+yN25pcHD8zsR2knB/ZkCJxqP0T02B Kcypzuyrjwo/YMpE0DVL7+Fjv1+58H4VSSrtR1AnBkYiwMUdQwWB/BLVWMY19sB4mfuF POpLtLoMIIwFYivc6E94v03n/AWuR5g7xnkrdOmj+luECM6sOUdvk9WmNmxJ+v6vzMjn zA9ith6qp2uYo4Rmh2IV/W9l9n8JbD/sKel1GloOoCq9S4z1KgL4KNiKob9tS4No1HzP ogzs3s+TCnk2bor5tSDbqsXeBf8JMsTE34+A4CYHBpq5aU6ohSWJkro3TkpvOY9uTJbC HMBw== 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=ZZYAoAY8tetmQOA8dg0WwzIsMgXeNDk4knAhcKtZO1o=; b=R9frIHkTJ6xLn2Rid8ouRZI71mnTT9Z4a0i4GXFSMCUwYvdYKZs0f3a6ysylsg2AIa TCKWs6FjzhE2JA9DeiI+XtpKd1aeww1Hf3sKwueUMQl7ZQcbViqTEMdr+h61CVMN/MUV YrSPXRtOgeaYtElWsDMa6BQPsj/KfPqnPSnxw1pn+f3RUpoY/ZBFCoEgLtYi/lOfjfQk r7zGMD+OdoqUC316Gz8jjJYk2MJ5iHKQDoxls3c4jHSvNoYeJkohl8dKYI85FSZ6MT1i zqdf+LkIrAx4kAq+1sRc2d7uWU9NRPvJdpvZx+DLmQVbFqFm6PijIRmSImMca3n4Klf9 wCSA== Sender: swupdate@googlegroups.com X-Gm-Message-State: APjAAAULLbNyS+SiVveT4bBNNWE6Z/q3RtUBxdNV9WkwZscWkFlQz5Y8 X9j5hVXcspZphQSZE+U6mRY= X-Google-Smtp-Source: APXvYqwfmodpqB0AlkCYscxAO2WYKe7ahhGWtBXunBvMCZuE2vh4w+3HP1SBBZxomrwS7r9kd5Xulw== X-Received: by 2002:ac2:59dc:: with SMTP id x28mr14439959lfn.38.1577025491837; Sun, 22 Dec 2019 06:38:11 -0800 (PST) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 2002:a19:c507:: with SMTP id w7ls1262725lfe.1.gmail; Sun, 22 Dec 2019 06:38:10 -0800 (PST) X-Received: by 2002:ac2:455c:: with SMTP id j28mr14880439lfm.184.1577025490963; Sun, 22 Dec 2019 06:38:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577025490; cv=none; d=google.com; s=arc-20160816; b=sWwy+ghwxB3fA91Ifu/VFHEph+HcO+PHMx/8i4dw1Y1UwyKPXcA3zFtscmbRdmI16t 7shzLVBszJ9BEqi5S16E8+eRXZf5L2YVJASHxYHlcS0wQTE8DPfPmoQ2r3TwDPpr6/LZ XZ2rhGmNJIkWYxhMmrhLNy+TGdsIO8PQSvx3bHPteprvVRzfmOjrqX32xpi33mJgVEGo cqaNqViyeOhw0Y2ZiyhFZkGpOdNtiaila47NTdxlym34ty/JmJ/AbRuZxnpilW41NgsF wRKs5jEdVUKJpmQ8/dehWwlU45ZNH0rETRSWuXZhjqNtP5kaoEpPtV9GjY/AYXy3YUuS SMvQ== 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; bh=/0vrIrjmP0pOw4G/PkZDszGZ40Y0+0RY++OsiMm72Tc=; b=zRtyVp6VFaK2jRO1HbPpE/UfVBCadyK0pEOKDzE/SaaXSXvZgmYlInSF05HIAD0DPO NmJka6eGu7Up1+yHOs39lXjj69E3l2mVqk2g9iK2ZrFYNfJAifGBnf54cPlPVUHS0mVY xxHyrCbX8pL/S9AZaEVWTbBBBhB/wRfmxzRmn+cXLVA66RmS3uPtB3o5cw3SclARx9zh BaFl0oAsP1NRLSrruyg1fDrVTYQ5mh0NUGUNPBsxHU0AoRBnifuSeKzkGgTtlMhPKAYJ C1QFbLT6VU+dKNnt+A/XId8F+V3NRXTSPufAqhTAZfQUB0MbNB/jSKCPpQDuiYfjqcYA lyIg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [2001:a60:0:28:0:1:25:1]) by gmr-mx.google.com with ESMTPS id z16si389338ljk.0.2019.12.22.06.38.10 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Dec 2019 06:38:10 -0800 (PST) Received-SPF: neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=2001:a60:0:28:0:1:25:1; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 47glTG1W9Xz1rGSM; Sun, 22 Dec 2019 15:38:10 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 47glTG1BWpz1w9Mw; Sun, 22 Dec 2019 15:38:10 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id TjcJPRMmL5om; Sun, 22 Dec 2019 15:38:09 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Sun, 22 Dec 2019 15:38:09 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 8FA7745404DA; Sun, 22 Dec 2019 15:38:09 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JgaKEpqMUbOA; Sun, 22 Dec 2019 15:38:07 +0100 (CET) Received: from localhost.localdomain (papero.fritz.box [192.168.178.132]) by babic.homelinux.org (Postfix) with ESMTP id ED3B84540314; Sun, 22 Dec 2019 15:38:06 +0100 (CET) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Mark.Jonas@de.bosch.com, Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH] lua: pass parameter string to lua scripts Date: Sun, 22 Dec 2019 15:36:04 +0100 Message-Id: <20191222143604.25057-1-sbabic@denx.de> X-Mailer: git-send-email 2.17.1 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
lua: pass parameter string to lua scripts
|
expand
|
diff --git a/handlers/lua_scripthandler.c b/handlers/lua_scripthandler.c index 7ec8415..1d0a655 100644 --- a/handlers/lua_scripthandler.c +++ b/handlers/lua_scripthandler.c @@ -32,7 +32,7 @@ static int start_lua_script(struct img_type *img, void *data) script_fn scriptfn; const char* tmp = get_tmpdirscripts(); - char filename[MAX_IMAGE_FNAME + strlen(tmp) + 2]; + char filename[MAX_IMAGE_FNAME + strlen(tmp) + 2 + strlen(img->type_data)]; if (!data) return -1; @@ -55,7 +55,7 @@ static int start_lua_script(struct img_type *img, void *data) "%s%s", tmp, img->fname); TRACE("Calling Lua %s", filename); - ret = run_lua_script(filename, fnname, filename); + ret = run_lua_script(filename, fnname, img->type_data); return ret;
Shell scripts accept parameters set as string with the attribute "data". This feature is missing in Lua scripts that runs without paramters. Add the same feature to Lua scripts. Signed-off-by: Stefano Babic <sbabic@denx.de> Reported-by: Jonas Mark <Mark.Jonas@de.bosch.com> --- handlers/lua_scripthandler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)