From patchwork Tue Oct 24 10:58:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Storm, Christian" X-Patchwork-Id: 829865 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+bncbdd6bwv65qpbb4fzxthqkgqenlujbnq@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="ZMpftrUg"; 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 3yLqyX6wypz9t2h for ; Tue, 24 Oct 2017 21:59:00 +1100 (AEDT) Received: by mail-wm0-x23e.google.com with SMTP id q124sf7817489wmb.23 for ; Tue, 24 Oct 2017 03:58:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1508842737; cv=pass; d=google.com; s=arc-20160816; b=e8kN2pHR4tnjpW10z8rDMCvZ2zaqTE6FzIr4mYvdSt+CRWVjjL/Ve+VbxHx/kKzg8z mMAPEGL4HWslZCdbNFdCpYfjengjEA1wgHIjjowf0FhKOrZMWW4/hSrKz8ICJ+Kbt3EV Ym/fHx7dR8WyvY9jH12IInrW6dqhbikOGZtWVpJ3ahWsJKCFW3XwTysd8O0oeGH299Xm 8BfMUwnxNhNHWgJ+YA0WfPu842rsz4aJeVkkl/WraSFR8CEfN2X500w052TSRtGMS5w5 dl6ZzdMCHhKdVm60lgSGQvLVKC9tq8tt9tO0QPvapMDwjQNHWHsEBFABPfXZaN5ct/NN ZB0g== 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=Tek77t4AQVUpYS/q4FjUWjP7IhHAWNnn5YupM5DXpHU=; b=hs3gx2q9bSR83SHXOxAzKz3MsTXi6rUVnD9ljCWI4suRpOYST5fIv8mMWKRi0LJuHI 1bNnMyzhSTmjLEDVjyU8IEXGgIrBLLLWS+Y0ZZR1yJTEIeRx4A7wORBB1IVflJV66IC1 ABgtWkTASRHsQD/USkpcTHXTOVLtIcVvjaUto+p6ytsbPYmVv1KCUvn2AQFa9FzfMeRw rfivhGGbx84yBUdzj6bsD83hNeasla5PRcgdx+o5ynB3NkHNtyuvmXIon2kDmI/A0NJt t+UH7Zq/YzRhK/1suqVqKBHWtbQW27CGWqXhXGJEAbaTqt3V1SdTRzu72Yo0AnvltDae b1Tg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.28 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=Tek77t4AQVUpYS/q4FjUWjP7IhHAWNnn5YupM5DXpHU=; b=ZMpftrUgXXLLBP24F24j5j7WlcNlHx1S06fUTht2+UFxEpfRpFVRk3RfE+GNDfLog/ LodXPyXZT2SMTeA9CkbM11JcHV2YjzfN/jxuTjWOS8OdZSk1Gc43G6vMXRoCYPc43m8Q OafiEwUml937nUKqHfiKln3GsDirkQD3zHUk7L0kamQhoDbLgXWaVyRLqChBdZSE8Ohu JFWzMrqFAIJupSXrI4WH74mRQiQW0ADltmyWNH+Q+sHy5GRyVSa0W69IwIScHxZXR9Li ZDZK0Z6kyiIx9tAFxRd0Lbg0shjLZZufhcZvoGTti6CjNDl6Wi6NmxnVl8ZPiyRKSX+i 0Z6w== 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=Tek77t4AQVUpYS/q4FjUWjP7IhHAWNnn5YupM5DXpHU=; b=podFQdHX0bIt6Lsu0vKOGZ4QcQiO0BSPbhXoZKfAOcxpFQIHp6ZKDqGV2LLZhAKch8 Vo7ZSiJ92XLAc5u9ZCWY3u8e7tVH+ROWalSX3QGE4YuSS/1dHHapq4hORPduN2s+cR1Y HR5ug32yIhnRmv8xVvwHKInQMu7y62/PhuRo5QNkIQj712Q6ucj790OGipnNWEtkarEl RD3X6Pk+Sp4HpNGtnc1h5xsOeyLWE0+UfIKExeP0cT7Q3Yfq6Ex/ST5CpSvYt1y4FJTf FFpEMxSfSac/uEoX9FNLiQRukf4zyIfKpzyQR0quY6cYuMQpToP3gPAw4SbsprhjlMgw Kl5Q== Sender: swupdate@googlegroups.com X-Gm-Message-State: AMCzsaXAtTJLLQMlDl6qzn+KsjgZ/bfEhP1Y86pOBer/Nl3NBi2FHQ5D PUZxbwEDF3VCZJZ8Y/8iZTA= X-Google-Smtp-Source: ABhQp+Q/AW49RnP8NfNhcUpK//q5H4u89xsZ6MxIhbhZtfhTCNvGQSECT9W+zMWoQu7Cb/s/1YkN9Q== X-Received: by 10.28.136.149 with SMTP id k143mr99649wmd.3.1508842737132; Tue, 24 Oct 2017 03:58:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.28.152.22 with SMTP id a22ls67129wme.3.canary-gmail; Tue, 24 Oct 2017 03:58:56 -0700 (PDT) X-Received: by 10.28.150.130 with SMTP id y124mr1021348wmd.22.1508842736765; Tue, 24 Oct 2017 03:58:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508842736; cv=none; d=google.com; s=arc-20160816; b=vQsqMfLl+hQ4pNYuFdvKj00qPHPOA0frwEtSW6shVVhwvDP91j5ogzmBRHmB2AcZF6 1CP1Zboc/Ybl3SQTS+oeT7F5Q9eUruOv5G/l+oR63R0Mxh5zkZQ0dOer86/i3mwGpiZF 5c5LHzalYvmiURHWksaJ5jmjP252rZMuMKQIBEH1wgfqail/+Sbs9vrz3Yki3aKA4d+6 cB3s/JTiBH6DM3xHedKUWf4gq7ySJq6AW5CSTfN/pQFd8Mht3Pa4iYSsfUEe2Wu+hcf6 Jw5lhJjzDhsNfDNG3pIyjsgYCeA9k97tRZSQzLSeq4BhGYn0LLMYl385KF0PsrAyDai9 j74w== 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=QYPDPYXfiHe1hF7fPo1/hS1vclAAMJzRMbJGUF+xSpE=; b=cs8nFmm+p3//DqOnhxaUWwXsYZtS0y1FDqelN25JGHN7OF26Z5I9Tm0QaJcY2mh4Ln xxmGAVh6PlJ94F+jPlrQeRfN0FbYP+k/dh+Q+FFiien0SAzQaae4XWn20yqp37e5zKZ1 38+r0EnDsJCKNjUto4Ifqly6qsPYJTjchKovK+IF+8R/0pzFOiB7DkZdWuEZWlKdoTEt lpIOw7cqol5wh3LNcr4CnN7mU1xHF5+SSJUwlkch19ABEdJzWy8VggM1S+THOL5vTzd6 YQvIcmip9LxPB0u93cdidp5VA8TLk5/WAnh1Wy6rXK/ByQpAUz58MLiLDZdnzHEnD+C1 K6aA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=christian.storm@siemens.com Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id p70si1326wma.1.2017.10.24.03.58.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Oct 2017 03:58:56 -0700 (PDT) Received-SPF: pass (google.com: domain of christian.storm@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id v9OAwuEV007549 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 24 Oct 2017 12:58:56 +0200 Received: from MD1KR9XC.ww002.siemens.net ([139.25.69.251]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id v9OAwuni029594; Tue, 24 Oct 2017 12:58:56 +0200 From: Christian Storm To: swupdate@googlegroups.com Cc: Christian Storm Subject: [swupdate] [PATCH] Lua: make table2image() and image2table() symmetric Date: Tue, 24 Oct 2017 12:58:22 +0200 Message-Id: <20171024105822.31118-1-christian.storm@siemens.com> X-Mailer: git-send-email 2.14.2 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.28 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: , Make table2image() transport the values back to the C domain that image2table() has transported to the Lua domain beforehand. Signed-off-by: Christian Storm --- corelib/lua_interface.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c index dcfcdf3..97636e3 100644 --- a/corelib/lua_interface.c +++ b/corelib/lua_interface.c @@ -240,12 +240,16 @@ static void lua_bool_to_img(struct img_type *img, const char *key, { if (!strcmp(key, "compressed")) img->compressed = (bool)val; - if (!strcmp(key, "installed-directly")) + if (!strcmp(key, "installed_directly")) img->install_directly = (bool)val; if (!strcmp(key, "install_if_different")) img->id.install_if_different = (bool)val; if (!strcmp(key, "encrypted")) img->is_encrypted = (bool)val; + if (!strcmp(key, "partition")) + img->is_partitioner = (bool)val; + if (!strcmp(key, "script")) + img->is_script = (bool)val; } static void lua_number_to_img(struct img_type *img, const char *key, @@ -253,6 +257,10 @@ static void lua_number_to_img(struct img_type *img, const char *key, { if (!strcmp(key, "offset")) img->seek = (unsigned long long)val; + if (!strcmp(key, "size")) + img->size = (long long)val; + if (!strcmp(key, "checksum")) + img->checksum = (unsigned int)val; }