From patchwork Mon Aug 28 11:05:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Faustas Azuolas Bagdonas X-Patchwork-Id: 806506 X-Patchwork-Delegate: sbabic@denx.de 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::239; helo=mail-wm0-x239.google.com; envelope-from=swupdate+bncbcf5bcwlqmprb67rr7gqkgqepmq4egq@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="OZx5COvx"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="luvMUZHp"; dkim-atps=neutral Received: from mail-wm0-x239.google.com (mail-wm0-x239.google.com [IPv6:2a00:1450:400c:c09::239]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xgppR54tXz9s8P for ; Mon, 28 Aug 2017 21:05:34 +1000 (AEST) Received: by mail-wm0-x239.google.com with SMTP id i76sf43553wme.1 for ; Mon, 28 Aug 2017 04:05:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1503918332; cv=pass; d=google.com; s=arc-20160816; b=oaHRhlN0ZHE1TQ9cmLyPyibUssfBY+moohCV66VJI1ydRJoln6TGpvf6nyA11Jw//I o+88VtBiJVulh+5ZtPGNnd74Ned7xM/jMZDY1ZTg6HwHjSuhun3cpqzLp3+Dgq/OcJK0 GiqAUl8PChRuyeT+NL0uJNcpV6z3YHHyBxzWXZuIhuP7k4MD7AHWw8x52hf9CEIWrngB PYObpPW13GZfC7L5geXhjMf9hoZDfkZOYpQfXZri9B7sWDOSSMxuPoLTtuQgF/00nPTH b6HvReZFKSYLjKOH36agUPqWjf7oVq5cjWWjpDSy04myvupn4WYo19051saNAsTb+s8E Omgg== 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:signed-off-by:message-id:date :subject:cc:to:from:arc-authentication-results:arc-message-signature :mime-version:sender:dkim-signature:dkim-signature :arc-authentication-results; bh=cM08oes8dB6KRy5HQ64Xwf+GAWO122gACk/NSNHZyXc=; b=T0/3sturbo+1Qy71SwcbCpZfNgBdXQMnZ91O7HGAt/PK/nmg3YZijb+7slmkopIUPu XWI4y4dQFOuFAuaQvBN8MK0f5mSrDF55RaYGHy6BsNtgz5unmIvcQBMJv7dA4KiW6ZAR WsRmfpx0J05kCRLeWdtuVCtTBQ3hWQazTZIObDc3gL0bZ//diMBhJy0zI1UrbtRFv91c hmLsrEbHcRyuNWeHl8B23bQV562Brobe95cUuJ6lkysOv3uJAFKoLEjQAox6IqiOK4xF 6i4XmPg43jpesb9AWwJaVLafrs0/468UxkyK3WZ+4ZuF2m9n5jm0ZdEpoJTJxXBPvIFr C1Jw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=niB3YsSr; spf=pass (google.com: domain of afaustas@gmail.com designates 2a00:1450:4010:c07::232 as permitted sender) smtp.mailfrom=afaustas@gmail.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.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 :signed-off-by:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=cM08oes8dB6KRy5HQ64Xwf+GAWO122gACk/NSNHZyXc=; b=OZx5COvxEr9YkSl+hWwLZiQ0vsKwHIuS4Moynq6oeizeyNrjyh4WFVCfGrANzBfwWT WFYm9p0JP74Y1Lt7x8LHgcBKxKlOFjND64O1H5K+NyIPmW3DhujAP1Xw8OfWuqfC9/LG MDfSW8TJBrKXEtUV8Yd+f2XvFS8Q2B6JHiSeBe9cSvyPPpD/wQ68WKjniMXBWHCh0mO5 ll5mTZcxrpGvxGfFpVrFaN8IAvk1gYLrYxVKXOYQ9SxqROcC9NKR0nPYhYUlhTVo1v6x IXWJBA5YBEULa3NJ32esYZsljxZ1rjDWY70cBMX9zf3cfx7ORjov0VM5RNHma1Z6iTCs k8dw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:to:cc:subject:date:message-id:signed-off-by :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=cM08oes8dB6KRy5HQ64Xwf+GAWO122gACk/NSNHZyXc=; b=luvMUZHp89wB+FWtZbfkAEKtdoc9ySQ0N2JnpjhgyisgtnWQ0hUl1Mr5wGwfv3z8B6 UU1usrn1lxWQFX7xUPxxUwuREy75VSSGmbuQ3OgFWHWFuqzSdbhY0QUuR9fQ8VX2E75f eAIjSj+jHLiT32mAhtPlB0KMse1BoWgBa2fArku8VrFxrnDaAYXZwjcWuJ8r1LCysFHi Cx1Dma/l7PKa0VVd+OwnW5477e+kkJ7/IQDdzcV9G5HjUApdaEdf+xwO5Bh0WxSAdhoi v1AmlEMcSHtWGSErSczhJLeGEKWyvUoGtJngd2OwNZLeFe9D2UICJFyq+4fIaCqedxtS QfHw== 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:signed-off-by: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=cM08oes8dB6KRy5HQ64Xwf+GAWO122gACk/NSNHZyXc=; b=T2TuJHIbmyNE5pxaCWLvxtGI11U2pU+I5iP/kLaacCqL6TlhNfaAMAPHdd/1fk6Q6b ZypO5VJ1M9nV/xgwhOqO7OgdGugWl+WoA/Nj1QOPz1ZM6q0rVsc+LJl9NK8QfjcYK0b8 uyaiZ/2kpkTJHT9iHe//4Dd0ATNcF9HxzQG5fm+CpPc4MIBUjOfTBrRHK5IXB4czLZtt H4GQUwt9SmMdgkegTFLwTFgB7353fRdWXgwR4zlIGgy1+s5HfR3UqEwnGWxWn+xe7tCX SOZoV8ZAisdgX63J0s5KZH71nxZzQKwQA4hDLe2IsSF2llaAeiMOWyNqGQi+0fm0ipVL 8HRw== Sender: swupdate@googlegroups.com X-Gm-Message-State: AHYfb5gMkcLSwUgEDE1aK4V0/FnaITYdwaUMt1E7atsBy4yneNwJ1Pj9 8YBEe5NF8nP5gA== X-Received: by 10.28.109.197 with SMTP id b66mr142wmi.9.1503918332057; Mon, 28 Aug 2017 04:05:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.28.30.7 with SMTP id e7ls31764wme.17.gmail; Mon, 28 Aug 2017 04:05:31 -0700 (PDT) X-Received: by 10.28.142.74 with SMTP id q71mr5419wmd.17.1503918331712; Mon, 28 Aug 2017 04:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503918331; cv=none; d=google.com; s=arc-20160816; b=tPPwuPjqBCyMaHgY2I3s/LEPsmWNBhba5Vo3OKXYYVN5Ov51NQPJSHBQzHfuuPNDtL RD3dlK5eoz1zENwP7njgeRjdARh8Zavuh6v8bJOAtK9/Tn+Tzvqr2LiEtP9TV2D7wOHc xDVy0dhr0gYsvf3VBmfYx25A1QzSWjKR0x4rzs2mt8cyhFaw1KXx0SKyzOGJH75nA0P7 FGZ5gJZLNz0DC9aUsNv2Sa6PuUJblnWeqqZHv3O1j1yiSHF5e+bJTzUF+YYqe6kn3LQ5 mntZaLDxBXqsGz9oNmfhVpZuLGB+BmKihSZa4AgE1bUGZLsZEXP1pjGqSxue8FSkQBJ4 9hAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=signed-off-by:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ii92zXTL8itdrwVm99/iXML9zgF8Mg1Kp/GzPK5FD20=; b=oaFrqPQIIwL7GXo9+/B905j5ZdusLq0m6whapopv8JT1hKLswkPBruomqcRIgtzwc7 SDloF0Pr8CryenBHx7ERafZKipUqAEajadnpC8EyPSKmwizuKqdOZo1ir+zSxv3sXv9X NiYY+h3aMVMragCPnuKtzBRv1xbdt4QHDRu3TgwM78HWhTsiicF1d1BvHOc0HMoSlgiu NAAawXU5M50/b5LzX7h5pABIvt9WQZeTVonhm2qyc6vwFj5lML/fHKB2IStNgsWoki/6 B8Ji6Rg53T/bxNSxvtCac+p2hkKGxwAWfcoVflKFH8CZz506qHhPA7maqQ8xFrUSoB9z 1hHw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=niB3YsSr; spf=pass (google.com: domain of afaustas@gmail.com designates 2a00:1450:4010:c07::232 as permitted sender) smtp.mailfrom=afaustas@gmail.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from mail-lf0-x232.google.com (mail-lf0-x232.google.com. [2a00:1450:4010:c07::232]) by gmr-mx.google.com with ESMTPS id f142si210373wmf.1.2017.08.28.04.05.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Aug 2017 04:05:31 -0700 (PDT) Received-SPF: pass (google.com: domain of afaustas@gmail.com designates 2a00:1450:4010:c07::232 as permitted sender) client-ip=2a00:1450:4010:c07::232; Received: by mail-lf0-x232.google.com with SMTP id d17so723358lfe.1 for ; Mon, 28 Aug 2017 04:05:31 -0700 (PDT) X-Received: by 10.46.4.129 with SMTP id a1mr77897ljf.117.1503918331249; Mon, 28 Aug 2017 04:05:31 -0700 (PDT) Received: from faustaspc.lifodas.local ([213.197.143.19]) by smtp.gmail.com with ESMTPSA id 7sm40986lje.5.2017.08.28.04.05.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Aug 2017 04:05:30 -0700 (PDT) From: Faustas To: swupdate@googlegroups.com Cc: Faustas Subject: [swupdate] [PATCH] Description field has been added to the default parser and fixed incorrect update sequence. Date: Mon, 28 Aug 2017 14:05:26 +0300 Message-Id: <1503918326-7716-1-git-send-email-afaustas@gmail.com> X-Mailer: git-send-email 2.7.4 Signed-off-by: Faustas X-Original-Sender: afaustas@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=niB3YsSr; spf=pass (google.com: domain of afaustas@gmail.com designates 2a00:1450:4010:c07::232 as permitted sender) smtp.mailfrom=afaustas@gmail.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.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: , diff --git a/include/globals.h b/include/globals.h index ddb42de..8ac0222 100644 --- a/include/globals.h +++ b/include/globals.h @@ -23,6 +23,7 @@ #define BANNER "Swupdate v" SWU_VER "\n" #define SWUPDATE_GENERAL_STRING_SIZE 256 +#define SWUPDATE_UPDATE_DESCRIPTION_STRING_SIZE 1024 #define MAX_IMAGE_FNAME SWUPDATE_GENERAL_STRING_SIZE #define MAX_URL SWUPDATE_GENERAL_STRING_SIZE #define MAX_VOLNAME SWUPDATE_GENERAL_STRING_SIZE diff --git a/include/swupdate.h b/include/swupdate.h index bff757e..f65a109 100644 --- a/include/swupdate.h +++ b/include/swupdate.h @@ -114,6 +114,7 @@ struct swupdate_global_cfg { struct swupdate_cfg { char name[SWUPDATE_GENERAL_STRING_SIZE]; char version[SWUPDATE_GENERAL_STRING_SIZE]; + char description[SWUPDATE_GENERAL_STRING_SIZE]; char software_set[SWUPDATE_GENERAL_STRING_SIZE]; char running_mode[SWUPDATE_GENERAL_STRING_SIZE]; struct hw_type hw; diff --git a/parser/parser.c b/parser/parser.c index 178966e..c5526c8 100644 --- a/parser/parser.c +++ b/parser/parser.c @@ -491,10 +491,11 @@ static int parser(parsertype p, void *cfg, struct swupdate_cfg *swcfg) /* Now parse the single elements */ parse_hw_compatibility(p, cfg, swcfg); - parse_images(p, cfg, swcfg); + parse_files(p, cfg, swcfg); parse_scripts(p, cfg, swcfg); parse_uboot(p, cfg, swcfg); - parse_files(p, cfg, swcfg); + parse_images(p, cfg, swcfg); + /* * Move the partitions at the beginning to be processed @@ -549,6 +550,14 @@ int parse_cfg (struct swupdate_cfg *swcfg, const char *filename) fprintf(stdout, "Version %s\n", swcfg->version); } + snprintf(node, sizeof(node), "%s.description", + NODEROOT); + + if (config_lookup_string(&cfg, node, &str)) { + strncpy(swcfg->description, str, sizeof(swcfg->description)); + fprintf(stdout, "Description %s\n", swcfg->description); + } + ret = parser(p, &cfg, swcfg); config_destroy(&cfg);