From patchwork Thu Jun 27 13:47:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe REYNES X-Patchwork-Id: 1123375 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:4864:20::237; helo=mail-lj1-x237.google.com; envelope-from=swupdate+bncbaabb6mr2puakgqeky55zua@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=softathome.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="BO19eq4I"; dkim-atps=neutral Received: from mail-lj1-x237.google.com (mail-lj1-x237.google.com [IPv6:2a00:1450:4864:20::237]) (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 45ZLn92vXMz9sNC for ; Thu, 27 Jun 2019 23:47:41 +1000 (AEST) Received: by mail-lj1-x237.google.com with SMTP id 3sf656889ljq.12 for ; Thu, 27 Jun 2019 06:47:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1561643257; cv=pass; d=google.com; s=arc-20160816; b=HpYhyvLzyX9LEyJnWHVnc1QucZyS2MX+o4EZsVj1qCGxOjzKJW6n5zU1ULqZWVEI4b pdBkj2r24/OmWe3ZV+4mCgCCt57T6ojE7RrkavsGb00gQWANbEzh/yQslGBXwtW1booV LkdEfO+45XnXDb4LON7wgKRyZBkrIRuU7gy/DxDtlS7wtY6/TvJcoBdf0ZMc4wDmko2T M0B1v/G6Wb11TqTwTVao52aaKlrB1DrzLUd1WV4Tdt95HBDNgNPDhO1n5/vhLt10JwkO mxRcUJUmf5SjdVbo6UCA+Cce7dA3q04V7xmscAEZT7AB7sT47mRESkIpyFythTU51TM/ rwzA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:mime-version:sender:dkim-signature; bh=Ohn9JLPxU4S5HHMBljBuajgu4gcEVdqv+JDAAfZic1w=; b=Q1ePG/spZRGe7fKBBYo4GvrzPWUlLUTQefZycEcNmKOhWiSEgCEhOLq2FNLoI2bSyh GyBFlcA3yDuCLPqM0TmR2FN7vWSwAlgpQMcFvsO9jMTDPqqpjve9RWDM65ARdjxZuMQs xYIzhkcJq5Z/r8UWRdgDP2h69xYi+6kfUCfoVcSHqL6RjfngVzpmfYDQNNvOSNpzOrwI BfeR9Bf0DaTAcog5qlUPJmbcyxixfRg58RmTFDNLAqsT/TD6w/qywfrdTkoBTZr5mK7P /cwylIFxnJVs9v2fjTkLrC7qK44tcsYP3RQBWjiBPQlya5jf7ME0LU0244/P1QHbvQ7K Bu4A== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=softfail (google.com: domain of transitioning philippe.reynes@softathome.com does not designate 185.56.204.33 as permitted sender) smtp.mailfrom=philippe.reynes@softathome.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:in-reply-to :references:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=Ohn9JLPxU4S5HHMBljBuajgu4gcEVdqv+JDAAfZic1w=; b=BO19eq4I6MzHi6U2lnASSC6vgRM/XByUKE7FtDJce1BC/CTG6N6iFBtAet8+s932Kl zqI2QZRHiEKmJWkoLdeRVPQvCS6nAUnjpNSNUntFSHuWhu8jrU/xdb78Rv/0rHhcfyyM FYI3ee/+AVwA9BWFlphKAdbMZ/AMVIDYLql33CmCmyek5zev0Cnwbq3R+KPvt3y2+Aai wjYdAyKE0UXa9SrUxpRfzXB5YoftlCDcbjG2049h/hBRSoX5x0gJ0lDgXi3fIbfdws8J 74FbAjDChXQz5eoNtFmNa2U70fMoe/5zC6kdxmFCV0e+oDO9nhIESBc669oA6zIwo8sK 0gsg== 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:in-reply-to:references: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=Ohn9JLPxU4S5HHMBljBuajgu4gcEVdqv+JDAAfZic1w=; b=OzuOQT1jY0uuz6e7sMaycwzMTkPQvWmxUEDLiMDUahvuEFIfNyDWztTm33ijVQgig+ YlADwUjq1RxWI9Jk/Qdo5VIJUdim0BnprTWfXQCJWKkSv3BFtRmX7xGfC+rQCb3cVDm/ olVQX/k8vWSkEN0XTh0HoGvyZ914mx10CLbml77hNKcIkLZPYXKygVORFCaRNsar7jW5 LYXKbMxUWw1WxY96TtidIHwQpha/KrAHzVrcfnl3Bv/H5y0j6xykyD4Zm7jhjnCRBNR7 iHyRSEMkIvBXWD78LKLxuSX/5fks24vFRr7pcs87nLN05RfmdZg7IQbI5TRrloXKsY7P NygQ== Sender: swupdate@googlegroups.com X-Gm-Message-State: APjAAAVSd7xizmvzj6mNgOoIlSxouyXLGmzyUvmbWXSWlB3LARohXIuv Ih/A+nglBq1VA2Ufgyo8CM4= X-Google-Smtp-Source: APXvYqyPlzsSRny1GRfx13m+nmp7awhXNpAahUM0UrT0FTI0JA53ohHOL/ftwwyTWEFTY0mO41e9oQ== X-Received: by 2002:a2e:8495:: with SMTP id b21mr2700731ljh.149.1561643257807; Thu, 27 Jun 2019 06:47:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 2002:a2e:8917:: with SMTP id d23ls762348lji.14.gmail; Thu, 27 Jun 2019 06:47:37 -0700 (PDT) X-Received: by 2002:a2e:970d:: with SMTP id r13mr2716585lji.126.1561643257108; Thu, 27 Jun 2019 06:47:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561643257; cv=none; d=google.com; s=arc-20160816; b=r8tSnjk/OfUEqt1gWl4K0+ZEe1ozPzxSE7IKr1m5GnRawmCyuw4ufQlkAmjDkY6djm UxhFE5eiirDXHIBw3f83U69Th206J3EMVR3Z7fcMOZZMJeqOKfYEU9qLlz/iscAPCiIB RU2GmxIGIYIsRZehD7Xk/NVb5Xp97DiGhLD759aE9rClyZ6318OB4DWwpEbac5WkKD2N S26Yod99FFlgWOM9NtR8qfyj+hqYIhJh96yQEF7tt3altnNmtE7wXQpOr2mvVpCA8fKN 6p/XLXF+8eTF35ADLrWDwbBU4nRbnKtVoN9dKZk0wS7MCgrtdKOsyWvR1WyIJflxIlIf 95CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=lAafgg/WvBR01ky3SrAY/a9Cf4D7Kp5AcvibGXOAyao=; b=Jv33tFvwX+A2jytNTNNleQDV5zKwD1wtQVAiDbvJjK3xET8YbQu6WvAwcjXb2htynr j/caE4nN0KNz55wYVY0Kg3JoOFVwZFcMG6kl7d3Pzi7cC2Fakuz/Fav+iLAGW9bEnU+K imngmErIckbYr6wxEEZQIgcYJLG/JSXolGuGaC165WAqv8aDhv1MU8NTOdJeSdAHICqv wT6BMSnwLZLnRDS5/Z6FHbPgiQvk3dyDmH6nPE/KlseYZKPlkF8kt3CmmtK8fHD1kIfY KbmTNsechV+ZTgPCaRCuY7wQe/Is0A2EwrcI6iEilV2/fPpzvPlnjD9MYQrDTfTPwf03 nfjw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=softfail (google.com: domain of transitioning philippe.reynes@softathome.com does not designate 185.56.204.33 as permitted sender) smtp.mailfrom=philippe.reynes@softathome.com Received: from vrout30.yaziba.net (vrout30.yaziba.net. [185.56.204.33]) by gmr-mx.google.com with ESMTPS id h11si157823lja.0.2019.06.27.06.47.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 06:47:37 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning philippe.reynes@softathome.com does not designate 185.56.204.33 as permitted sender) client-ip=185.56.204.33; Received: from mtaout20.int.yaziba.net (mtaout20.int.yaziba.net [10.4.20.37]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by vrout30.yaziba.net (mx10.yaziba.net) with ESMTPS id 5D2BA51E6D; Thu, 27 Jun 2019 15:47:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mtaout20.int.yaziba.net (Postfix) with ESMTP id 7AF89160465; Thu, 27 Jun 2019 15:47:36 +0200 (CEST) Received: from mtaout20.int.yaziba.net ([127.0.0.1]) by localhost (mtaout20.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 24TMByalEBiI; Thu, 27 Jun 2019 15:47:36 +0200 (CEST) Received: from sahnlpt0333.softathome.com (unknown [149.6.166.170]) by mtaout20.int.yaziba.net (Postfix) with ESMTPSA id 59BD7160461; Thu, 27 Jun 2019 15:47:36 +0200 (CEST) From: Philippe Reynes To: sbabic@denx.de, mk@mkio.de, hamish.guthrie@kistler.com Cc: swupdate@googlegroups.com, Philippe Reynes Subject: [swupdate] [PATCH 1/3 V5] scripts: a file is no longer required Date: Thu, 27 Jun 2019 15:47:22 +0200 Message-Id: <1561643244-23158-2-git-send-email-philippe.reynes@softathome.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561643244-23158-1-git-send-email-philippe.reynes@softathome.com> References: <1561643244-23158-1-git-send-email-philippe.reynes@softathome.com> X-CLAMAV-SCAN: ok X-VRSPAM-SCORE: 0 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrudekgdejtdcutefuodetggdotefrucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhestddtredtredttdenucfhrhhomheprfhhihhlihhpphgvucftvgihnhgvshcuoehphhhilhhiphhpvgdrrhgvhihnvghssehsohhfthgrthhhohhmvgdrtghomheqnecukfhppedugeelrdeirdduieeirddujedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhht X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht X-Original-Sender: philippe.reynes@softathome.com X-Original-Authentication-Results: gmr-mx.google.com; spf=softfail (google.com: domain of transitioning philippe.reynes@softathome.com does not designate 185.56.204.33 as permitted sender) smtp.mailfrom=philippe.reynes@softathome.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: , A file was required for scripts. We may also have a script with a handler that only used data provided in the properties. So we update the test that block script without file (and filename). Signed-off-by: Philippe Reynes --- corelib/installer.c | 5 +++++ parser/parser.c | 8 +++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/corelib/installer.c b/corelib/installer.c index 2dda40a..498fcc8 100644 --- a/corelib/installer.c +++ b/corelib/installer.c @@ -99,6 +99,11 @@ static int extract_scripts(int fd, struct imglist *head, int fromfile) const char* tmpdir_scripts = get_tmpdirscripts(); LIST_FOREACH(script, head, next) { + if (!script->fname[0] && (script->provided == 0)) { + TRACE("No script provided for script of type %s", + script->type); + continue; + } if (script->provided == 0) { ERROR("Required script %s not found in image", script->fname); diff --git a/parser/parser.c b/parser/parser.c index acac406..24ba6ba 100644 --- a/parser/parser.c +++ b/parser/parser.c @@ -365,12 +365,10 @@ static int parse_scripts(parsertype p, void *cfg, struct swupdate_cfg *swcfg, lu continue; /* - * Check for mandatory field + * Check for filename field */ - if(!(exist_field_string(p, elem, "filename"))) { - TRACE("Script entry without filename field, skipping.."); - continue; - } + if(!(exist_field_string(p, elem, "filename"))) + TRACE("Script entry without filename field."); script = (struct img_type *)calloc(1, sizeof(struct img_type)); if (!script) {