From patchwork Wed Aug 28 05:20:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1154157 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::437; helo=mail-wr1-x437.google.com; envelope-from=swupdate+bncbcxploxj6ikrbge6tdvqkgqehefkmai@googlegroups.com; receiver=) 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="EndU2VB+"; dkim-atps=neutral Received: from mail-wr1-x437.google.com (mail-wr1-x437.google.com [IPv6:2a00:1450:4864:20::437]) (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 46JDbK6tSBz9sNf for ; Wed, 28 Aug 2019 15:20:28 +1000 (AEST) Received: by mail-wr1-x437.google.com with SMTP id w11sf727544wru.17 for ; Tue, 27 Aug 2019 22:20:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1566969624; cv=pass; d=google.com; s=arc-20160816; b=aChlmT93sUJU0ATVWT/vwKN8N03d6CTT3SbG2mrlhwQKqwvtjZi8uGvd4e0ubR8Q5p QjM7szeKDy1PwvAtsV0JIp1B/yf6Ic9T778um8YLb9Hlc1qiKQmJpNG6j4P1kkJRHVDv 7OHYckOFPq1jM3SfLxhBDgnkRzhkuhZiAM1zEq/ZD2WhlDW/rEMJ2zhbKDeoNv9/ZQeZ TDMHJQt0SQ6K45yYycDMZXRxWTNCamBr1XmTscQXPg4+w9ckwikFFcZ3x2e6p5bF3MjG zeAzOIgO4JYXceG0nbyeY0Z8LWrthFBCR0iv66nTaCcXxL6ivNBksdYbBH0832I1s8g8 anMg== 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=VeePJFP9go9Bf5CgrJWjXkhffIChBBAl39Jove0OsHM=; b=Vgixqh/BrgquJ/jf99LSEyGTxvyuDH08b5Je5AJcAU0J+X6AND41BJSvTbmxcPVdlT RZBDP/MUl0Sp6gMegBlV6dnjvUiBHvwP2xad4o3oX7E64w9q0GCKL2SqP2PG6797bVXL pkHe+s0inX6OuoZ4I5O/8c2RH9ztqIlF2uOs/xPGGndHCfE0yfSeY3KXem4xzPjzL2GN T4iZlM70jeZfoBdQhExh79aA2lfaf8e/jSMBUFrql1+rZFuyI/zisIftx//8agKLl/Th bWVbJovTuofld29dp6WHPRgiAy/XsjGx655cPMzVtd/cXHKdFVHYkzNb/4IiIDV82u7X mPCw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 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: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=VeePJFP9go9Bf5CgrJWjXkhffIChBBAl39Jove0OsHM=; b=EndU2VB+5U+cU8zVbXzC4GG/iELOA6MIVor0/0y6EvQw1mRJY5vs9N4wjwj1GYbFyN ScijSpk/H6f3VaWyT/VJojH/JtEDUDAXZbYRxiJ/7RSrQG4vNafKundagO2459qVR7PL BN0gT090t5FrA1M0UDOLVtO26tiOV814TZmaUSFFO0IA5bwL8OwsxIA8mnn91VtHfrcU LoUY+PvLvyKQDqa+SYcJZTfw9Tdo68NigQTTZNzoyTInrJUExDShZuESKEdvxLgxrbNj fygKyiW04lqWr7/HBZjBXVP2b/mMl3ik46c/NxvlyLOPJa2OXXyR6frGNzaB2fn95wH3 VYvQ== 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=VeePJFP9go9Bf5CgrJWjXkhffIChBBAl39Jove0OsHM=; b=ZNYJa+jIOd5mls4CD8qOvITb7ZY29SuoXaCZ3WqQ/38XXUgWR6P/IZwChkEC142Qoj 2ZbkZMifH83GWAH5Mrz5Ph+X6TenyE88gtJub2uLYAUej4DZzYziwdxhVDqxZoA+JED7 PQ8A3clZBoV5V/T7jAPluaPTYa327kRcqpsRNWuU9pKg/+Sf7KG7PUkY/f210MEGduqF fRgygFT+AnenYEAPpX6a0am4XwAQoNp100izj24/57ybGp7a9rre8b4RfCWW5+gl9dCm gMl/xYbXj0JfIn6YZ5InLYr7fnz3e+mam426VCLyN7KrD/0WoFt1KsUKtx0wozke3U9G SSXg== Sender: swupdate@googlegroups.com X-Gm-Message-State: APjAAAXi38PY4UM7eGG4/4RFki2oDh6idraib4hz+2v/2PhSGP9n5U3s GCDCTb38QaB7BmoXolWz+fc= X-Google-Smtp-Source: APXvYqw7hYXCBXoiJJAynN5iclglaXeilx0aUq7ybhRJG8ahBApsD1VHE0A5QnkEQ/sPkFvKE+LdAA== X-Received: by 2002:a05:600c:34d:: with SMTP id u13mr2400724wmd.48.1566969624255; Tue, 27 Aug 2019 22:20:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 2002:a1c:a557:: with SMTP id o84ls425042wme.3.gmail; Tue, 27 Aug 2019 22:20:23 -0700 (PDT) X-Received: by 2002:a7b:c019:: with SMTP id c25mr2413813wmb.116.1566969623805; Tue, 27 Aug 2019 22:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566969623; cv=none; d=google.com; s=arc-20160816; b=GkbZOoGpf4beMXJ8BU5Jh1JQrOlbme7t/bsDCwz0H/IUuK9HJwRvrb8aMxjDad3bNF G111zQhGg78mIFpK6i1fnsBehWBRb6RlrTOqPuYFRTCRW2pkRIqYn6huPp8+/KeWwj0T Xy0a0IDDK7BHF7sxg4uvHuKSQd71oNRIvs+I5gZ1OyrUUojC2Oobv/Q2e9m+r4FtkgJ8 mf+xFDaEr//R0PeSOT2dYglKvTdNmHFFfeUobh4kFdP+5Bz5A7E51YnStQF4tWu6eSYW 3yDmnnVDOvHuD0Th7kQcu1Ys/H2cT+nWqyJjc4utne0nZJLcn3BmsInNucavy3Mb2xTb sHOQ== 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=FDRTDvWx98TQTRIsRVnnjprQKUAivZw+E8gHHOC+Wp4=; b=cHmeYeYgygCPbs+s8iExD6uyv8MfMRb27LOArOixIAwKMesE424zL/FtQxfIQ+WUDj FZhSWFY3JbQg7nu+wYGi1H29x1/+YqYuivpj15b61kWLfQARvA2n1jYhpwAkB23tg4xX N5C++CuRBYBOWf8D+FJmmxibTKpLp+9UrYyZC1O7My66xiQ0Om/jNKCPxlIZlvhWgHMx /sZfEk5TGsNrTZ7WDyTVe0ufcTHM162kj3H8Hq0LX9D7FFxIsB6TkAvFtBDHVr0nVZyU PzcVz2/r2d3eYnTRayutW4nZadZie+Dd/zh08bUxMNpFErxjZpg4yzVbSYEnD/98Gro8 AfUw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 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. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id g15si64077wrq.2.2019.08.27.22.20.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Aug 2019 22:20:23 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 46JDbC4Wpzz1rKJ9; Wed, 28 Aug 2019 07:20:23 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 46JDbC4KyBz1qqkv; Wed, 28 Aug 2019 07:20:23 +0200 (CEST) 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 Im1nuvtzaEVG; Wed, 28 Aug 2019 07:20:22 +0200 (CEST) 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; Wed, 28 Aug 2019 07:20:22 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 95DCA4540264; Wed, 28 Aug 2019 07:20:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([IPv6:::1]) by localhost (mail.babic.homelinux.org [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id sAX2N2RKHUJG; Wed, 28 Aug 2019 07:20:20 +0200 (CEST) Received: from papero.fritz.box (papero.fritz.box [192.168.178.132]) by babic.homelinux.org (Postfix) with ESMTP id 940304540397; Wed, 28 Aug 2019 07:20:16 +0200 (CEST) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [PATCH 3/4] parser: added output attribute Date: Wed, 28 Aug 2019 07:20:13 +0200 Message-Id: <20190828052014.2466-3-sbabic@denx.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190828052014.2466-1-sbabic@denx.de> References: <20190828052014.2466-1-sbabic@denx.de> X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de 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: , Define the filename to be used together with -o parameter inside sw-description. In this way, it is possible to store on demand different SWUs (software, configuration, etc.). Signed-off-by: Stefano Babic --- parser/parser.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/parser/parser.c b/parser/parser.c index b2a6ebd..e8c13a3 100644 --- a/parser/parser.c +++ b/parser/parser.c @@ -155,6 +155,15 @@ static bool get_common_fields(parsertype p, void *cfg, struct swupdate_cfg *swcf swcfg->bootloader_transaction_marker == true ? "true" : "false"); } + if ((setting = find_node(p, cfg, "output", swcfg)) != NULL) { + if (!strlen(swcfg->output)) { + TRACE("Output file set but not enabled with -o, ignored"); + } else { + GET_FIELD_STRING(p, setting, NULL, swcfg->output); + TRACE("Incoming SWU stored : %s", swcfg->output); + } + } + return true; }