From patchwork Tue Jun 18 14:24:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe REYNES X-Patchwork-Id: 1117960 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::440; helo=mail-wr1-x440.google.com; envelope-from=swupdate+bncbaabbm7iupuakgqe3kj7zri@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="P89dFzTy"; dkim-atps=neutral Received: from mail-wr1-x440.google.com (mail-wr1-x440.google.com [IPv6:2a00:1450:4864:20::440]) (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 45Sr2H50Ptz9sBp for ; Wed, 19 Jun 2019 00:24:55 +1000 (AEST) Received: by mail-wr1-x440.google.com with SMTP id l9sf4472703wrr.0 for ; Tue, 18 Jun 2019 07:24:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560867891; cv=pass; d=google.com; s=arc-20160816; b=OYn0eIcdtxTVufRaTZm5NwsX2pksLkNZVB3GJ1jeb4lb58YkVC0tthpStOftVZ509Y CRDRaSzzNXn91c3guhPsOXs8+QDtYkow0nydITpj2fdKLvmwlzxEeG0Cw9hFCIsVr/Ty zLZ1Fbmc/W9+qAtOFBcRlhCqKgRiG33jkQIK9qgiA9Pyxt+nDLCqS1URYsrGBG1W8LOv S1KM+BziiG2bI/eSYuZq8OTlPG9lP7mxNOstnTvCCx1Eb9kR7WhKtehJxYW8QV+Fhc3r 6WoXWjGUDmm5q1Q0xw6Ia+LooCl9r0erbsH/b3/HhJj2yWfx1vm2kfGvVb0cLDc3yOK6 O/Iw== 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=RGt3Ec2JAXJ5LClO2Pyv+lIq6+//T6eSgwZ4fY7oe/8=; b=h3kzCGhpaPAR4IjVoVUjpnGpxFugZW3dkEOArYRtJno23xK5klQtfk/rVcbtWoeQnr 54Iy2ZAOKLHqVA4LAU0ZaiDTu8wpBQ+myZ+Fd2h7ECn87EUi+VYsIHTZPbeTqWLSWfNo c6t3d88RJJS0mNmbWUNKIT1afnx3XfNzQ2FB798rKY0wYZIwfMx6gGz3/mxqkUsy9hvz exqkQpUqUTBCXP+mCS/XZZLlW8daU7MJAeRmLrNQhSfvtXu+1oxvqqW8jn0ZP7JkTMYO JZfPeq7JkeXyyPQoEF6OHhAB6+617GaNj1Cabq6VTz5x3GQSemF0lS7VGjrrpz9JuYDQ 7kKw== 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=RGt3Ec2JAXJ5LClO2Pyv+lIq6+//T6eSgwZ4fY7oe/8=; b=P89dFzTyGO2iFQYNe5tdJnjSFExVdfdtbcnPlX3rCWW5UD6n8oHez1QwNkt8U0wxrG MbbWO1h7qiPHaC/PmdeUGFesPHSuw0r9FPmbpRw53XhmyZZYryh7RTEAhTPrtabiIJWQ bk+1+4TO5nK7CCYw00VnrD0/W7dTaiTOBCg2v0w7hwHMdppwziX9nuKXuO19ZuAJ09EE NLaeKEDgVr6kD9EKt5wA1WuN883uu6hb7emyOizNw8uX/uFkMf81ByxZwXRWHLi186HS 0gYrQHQKJ9y0UHU9wWeycSAGXHbgEzbYOniIDcWt5/osu+8vSHea2H8OOYO791YxEg/h FcJw== 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=RGt3Ec2JAXJ5LClO2Pyv+lIq6+//T6eSgwZ4fY7oe/8=; b=GWOmEbhsTahLOXdpRjNakqovehK7GTnbg9FJcMLQgX0/uT3d+TY97E7HY3/n9yMykR oxsD5M4RsaWocMLkTFBjARTcKAWF5uQnNBGARi4zRMOJYUiFxtMftvR5uX7jTBstntGn KqQRSXDjEDL3qRTxqajXj65oTttrEFu8HWL5axBvBzv2l7U/CFTWmHOjs68VDrBQQlyd 3P5qJQY0sb9a4eZsyiG/3SY0Ca9jrkwnq3vb2CePx2kobXEiQho1hzyPX43b93bszMPJ vHmX5JnJAhe8nJ0HRb1Vw4U35Ec3TyyTu5Ul83XQrMxev0lB44SGHHrw/0qSiomKB5m+ yiug== Sender: swupdate@googlegroups.com X-Gm-Message-State: APjAAAV3/VswBqX1NpuJ2J34gHSbwfj32R3GeDUTGr554hjdt5d00Qyw JpvyZf2xO1yYcsliJAcVgrc= X-Google-Smtp-Source: APXvYqwtM3NtA8/zV/8XLIPsqAlow44cbMX/kZ2FRFaWq2a4u/cuUc5p8pDrkgctjCC9m0ilmhrUvg== X-Received: by 2002:a5d:46ce:: with SMTP id g14mr25376337wrs.203.1560867891354; Tue, 18 Jun 2019 07:24:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 2002:adf:ab4d:: with SMTP id r13ls3644328wrc.5.gmail; Tue, 18 Jun 2019 07:24:51 -0700 (PDT) X-Received: by 2002:a05:6000:114d:: with SMTP id d13mr16224139wrx.93.1560867891056; Tue, 18 Jun 2019 07:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560867891; cv=none; d=google.com; s=arc-20160816; b=IbKLgxOB3YmNVVw5+EzaSV5iOu6ygQ+MmCEUb+hrshPpkHYM8ANpyCiIveodUcG8eX lR0zgd6VP1noBu/cB65wrAQGRf4RbcS+3qZIz/x02JFRX/79xcXju3ua6u2pd67ApCYD p8LENX8+8pCsUnqIEV4eCxfgqe/Ydhn//DRe+7pNeGlC3oSEXGWlEhNYaMC55hF/oHac BijS5b8EMjrYLBqxAfLXFZIBQyd5utRgz/GJsxLnangjdAiblbskIbozgeFU6s3XLK+B aKLQ6Jz1zYYjnqGC7pJOdjHRH+WV6yKEut0oqBHkJfizwZoiQAzzyI+8xDZU7VtOkRDe edLQ== 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=2IR0d9a4aagjOR/Spy+5uqKnSK92rnkgrIZouaM1ZrA=; b=iqez2rDfIAWwL/zihrzNwe5+97/o9nHUm/TffSfzPvstwoJG6OaMSaiDxd0C8pt1ON C8cKTLeKBIomXgaRdB3+Kzj5eFMVtfMVH3MSo2U0AFH4qpwXFcl+U1jdGNTBsZFpyayA 0nM488xlyuPZcp8H7bvviLZ9QSBfZNOdS1x2DyEchvwXUBeL5aOwZ+8SHv8tUwPupwW3 EZwHRFROe5DfCQGXpITHBs6h+iLnnddnxYINhN+1GDUssRrJFGWvcpCWf+Nr7A2f81O4 OXn3OQGA1gvFQWz5Gpl0LzE4737gdiQHG49186JpE/LSJajCRhZnFCjZCnzBOhZm6K11 1Ttg== 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 q14si99251wmc.1.2019.06.18.07.24.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jun 2019 07:24:51 -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 E637A51EEF; Tue, 18 Jun 2019 16:24:50 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mtaout20.int.yaziba.net (Postfix) with ESMTP id CE9B9160275; Tue, 18 Jun 2019 16:24:50 +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 uSJAZg6znheZ; Tue, 18 Jun 2019 16:24:50 +0200 (CEST) Received: from sahnlpt0333.softathome.com (unknown [149.6.166.170]) by mtaout20.int.yaziba.net (Postfix) with ESMTPSA id B36C6160216; Tue, 18 Jun 2019 16:24:50 +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/2 V2] scripts: a file is no longer required Date: Tue, 18 Jun 2019 16:24:42 +0200 Message-Id: <1560867883-3726-2-git-send-email-philippe.reynes@softathome.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1560867883-3726-1-git-send-email-philippe.reynes@softathome.com> References: <1560867883-3726-1-git-send-email-philippe.reynes@softathome.com> X-CLAMAV-SCAN: ok X-VRSPAM-SCORE: 0 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrtddtgdeghecutefuodetggdotefrucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhestddtredtredttdenucfhrhhomheprfhhihhlihhpphgvucftvgihnhgvshcuoehphhhilhhiphhpvgdrrhgvhihnvghssehsohhfthgrthhhohhmvgdrtghomheqnecukfhppedugeelrdeirdduieeirddujedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhht 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 remove all 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, 6 insertions(+), 7 deletions(-) diff --git a/corelib/installer.c b/corelib/installer.c index 2dda40a..fb7b41c 100644 --- a/corelib/installer.c +++ b/corelib/installer.c @@ -100,9 +100,9 @@ static int extract_scripts(int fd, struct imglist *head, int fromfile) LIST_FOREACH(script, head, next) { if (script->provided == 0) { - ERROR("Required script %s not found in image", + TRACE("script %s not found in image", script->fname); - return -1; + continue; } snprintf(script->extract_file, sizeof(script->extract_file), "%s%s", @@ -198,6 +198,7 @@ static int run_prepost_scripts(struct imglist *list, script_fn type) LIST_FOREACH(img, list, next) { if (!img->is_script) continue; + printf("type = %s\n", img->type); hnd = find_handler(img); if (hnd) { ret = hnd->installer(img, &type); 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) {