From patchwork Thu Mar 22 16:52:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Faustas Azuolas Bagdonas X-Patchwork-Id: 889476 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:c0c::238; helo=mail-wr0-x238.google.com; envelope-from=swupdate+bncbcf5bcwlqmprb4v6z7kqkgqeaztihwa@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="elKbjZsR"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jaNjejWi"; dkim-atps=neutral Received: from mail-wr0-x238.google.com (mail-wr0-x238.google.com [IPv6:2a00:1450:400c:c0c::238]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 406XmP6Mrcz9s15 for ; Fri, 23 Mar 2018 03:53:09 +1100 (AEDT) Received: by mail-wr0-x238.google.com with SMTP id 65sf4548611wrn.7 for ; Thu, 22 Mar 2018 09:53:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1521737586; cv=pass; d=google.com; s=arc-20160816; b=f1ZlrvL6sJ9iMWFPoJVPlOKcf+EQNY8hSof9wgJRg1wEtK1rV69sicflV+Ufpzs06l 6/ixczzNYUhmU1rk+xzYa2BAwo4VlV5KV5Q08Ht8JQe7Cqrd1xtAVHOqG6KONfAezX4f 1hLERiLulZksuU7w+bp36yVlf2IWZfvOYLvyJnkCL1STMpl20AsJlS6PjriyIaUh8i1M yeXhfjR2G1bAcdXrcUN0X7sXW4IvG9Z4yCt0LhUkm1NwY67WDNtqiNsi0MbJ/XGbrb6n 6vrpj2lqugyGegRj7WSMRBE7P+jpL5LTKmi6AGqboM1TfcRq5Km/Y7NHtcjhisM9/weg a5Kg== 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:dkim-signature:arc-authentication-results; bh=tANwyDwBi3GdHw0SIQgif9nxzTMh5Ldv3Uvl/qy4QC0=; b=f6xBB0Ou/t0yBeLE1ju0x0pL2a9yiR/xGqYIliCaJ+okJoXQ42URmR33Jinxbd75+m sLcsp7p1A4d2Pf0bibGjJjy0B1epqIoLDsQcmjprCGbapgcG37E/Pn4sfx1bVBtE7tGd cH3QruSI+9V7FNeY8O+3g5nggqBj6gyy4vxW/Fs7d166XUK6YNx7FwYegexl9S9Nw2mM x763Esr2JaLCQiHCQtIr7lGKqSuHv3PuT8kRxuQgNK97hLb/xU0QjUMflzD8I2N5oL/5 MKmUMAlFC6e4lry3IDh5zoFJxnnkVM+vKK/Eybya878HjAzntBCbOKRZVbwBnGPfURRn l4/g== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=o0Ssf6BA; spf=pass (google.com: domain of afaustas@gmail.com designates 2a00:1450:400c:c0c::242 as permitted sender) smtp.mailfrom=afaustas@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE 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 :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=tANwyDwBi3GdHw0SIQgif9nxzTMh5Ldv3Uvl/qy4QC0=; b=elKbjZsR8LQCL2rHjGsWfAP62pEleHX7vm5X8765V8aRCvAiXRfJlWmKWblRFmbDPw edbFAoJpim9TF8iX2ltDjHj+jU+QqGSaSVnk//db2QEDkMqWvOQrNMcV0w7TPSBELA9e eC1OjHE1HVPE3qmYFJypIzSx8kDw37zyZUnRe1wgwZRBcrxHynyW2Lrsn972xep5m4+d efje0U6hGvn3JIF+Tbv8QRC7XgmAIJuCbjWVHqkZuBIUi5LjkSGixICFohmSV2N0R5Fd 1/iVe19BPqFt1EgBavztUBigm0gMRm3fQiQf9uesJi0iqhvokE5pSQszGZUeCGZJDkzn 65iA== 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=tANwyDwBi3GdHw0SIQgif9nxzTMh5Ldv3Uvl/qy4QC0=; b=jaNjejWivq5K51xuMBiG9dOkYpX5kePSL10TqgDe1xGsAjcB8Q8HhKUeJztXMFo9lA l8BE2+Pc7lqns/sYNknmeNQkqjojAqQp0Vx0f/RrJeh3CeqbJopXCZnzmdjx8xKzJKTL RpkfD11Jse5sNQF9TWhUq29Ez27RL1qZdc9aVaLaiT+noEMutfWWh7yA90Emq9jdp8IW mGw+D4bh156AD+btkQLBuD9PxKoMxlOfYjVHROz1jilkB6czscLuzDP/5L6fR8jPF3Pj rfZPk/mdd+kHLDcZ+efORpZ1Hk86h5RJK+Z5bF7AwEt3agZyYcPB9yq3QyVkm3oef/G0 3jIw== 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=tANwyDwBi3GdHw0SIQgif9nxzTMh5Ldv3Uvl/qy4QC0=; b=LBcboF/OCjKYjA7iW4KWN0GNGbdl+p+olV//h5XLeMjPtGTlk08uCsh4Mmd1xn9EkG 6QCQjYFTjD9oPQrCXvRGoixJQE07FrWgw2NEC1ifPG9sWqwhO5rtRgIjD+sTUM2uvc8r BH8wLZ7YEq00zycf6aJMhbV7PaQMEe+gwELcEa3WXxhn3TY1ujdrgtat4Ih76qvWM+8z DNqfoESfGMQR1uFQ4WDUFux/U1/oNd9X1JhVsrZK5MyX5qWFD2AZZQOL3Dn45EzOzKql aK5xf7TS0SkgIN5RbBELYvxOWQZ4y9znrDdFXmG/i+Erv9PI2vU96fwC9HjZd+qp+Xt8 E8FQ== Sender: swupdate@googlegroups.com X-Gm-Message-State: AElRT7FguDpbcym+8QnbAcfHZBfD3rnMgWFOiXv0pKU4cCUrl/iSCuRO XhZDd4v1uPw1g2wdFtxmN+s= X-Google-Smtp-Source: AG47ELsaCHsNep1qXJfqdaDIx9W91UO46cuzHoS7afrioGwAgSOLw6UesMTTCHXt+cPzGSJQlY3cLg== X-Received: by 10.28.74.10 with SMTP id x10mr147855wma.0.1521737586376; Thu, 22 Mar 2018 09:53:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: swupdate@googlegroups.com Received: by 10.28.143.84 with SMTP id r81ls1509590wmd.1.gmail; Thu, 22 Mar 2018 09:53:05 -0700 (PDT) X-Received: by 10.28.122.5 with SMTP id v5mr794293wmc.3.1521737585813; Thu, 22 Mar 2018 09:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521737585; cv=none; d=google.com; s=arc-20160816; b=F5X/+0BmrsTKuipenv5A4Cu9fEngIZKWXDVsrxGIHt+kpN3QlrubyTtJLkgn2l6nl8 PC2xPhD9x8yugwMdDHiIP/wMooSVLeB1yAa8HUWpIfEMcG89avSbfOaepAbfe/arjEGG k/el0NS5dUJ6Sb117vvtcjubKV44I5B6j1Ax0GhlKkwBhswcS8p0YvoXrZGBtPfIz7uW 8/a/w1ZaV043rwghOGv3J2d4BscJULwvP868D92dXIgHew5gmuEebU898+SoVOY/kM/e kWO2fwvQYtHU8cAbdUsk+dhx2eg7MnYxgqmOR7tX66HIIl6UmJ6Dq6dqGlPh8KFRA4hb 1HNg== 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:dkim-signature :arc-authentication-results; bh=4FQrXmZyAbUPh3VlM0Ci6nNMF4kKGqN3VLnp+C5zxDU=; b=kanvfHcnrDLd7nxAlex8fXOd/fqrKwSVJMpvpmFCn4+KBnRU1QcaGaC5QVeDisn3Su jJvneNI5Ra9nVFGH1xWleoEKYyS+mg50rU+rVMsnSZ72Y29usyIklGHEBd1WmW/FevGl we+RvkGVBekCByw6hfmfgtio9zssfxLtw3H9CIGM/FNcUp0Nzty26GPO9MIcI1ynUE0V ZdeUeNdMb0CGXqsxnDWHe3yVhbz52lTfSkBcE3abDVWnOwsfEhY90kxpy4wHzRUnCaxj SG9JYyCYpSLEqyQoMbcf+SywVdJodr2zH3NLpoviSOPl8jOkUzd6I4Ll8RKjedKQmXik t6qw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=o0Ssf6BA; spf=pass (google.com: domain of afaustas@gmail.com designates 2a00:1450:400c:c0c::242 as permitted sender) smtp.mailfrom=afaustas@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com. [2a00:1450:400c:c0c::242]) by gmr-mx.google.com with ESMTPS id b8si280533wrf.5.2018.03.22.09.53.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Mar 2018 09:53:05 -0700 (PDT) Received-SPF: pass (google.com: domain of afaustas@gmail.com designates 2a00:1450:400c:c0c::242 as permitted sender) client-ip=2a00:1450:400c:c0c::242; Received: by mail-wr0-x242.google.com with SMTP id u46so9414214wrc.11 for ; Thu, 22 Mar 2018 09:53:05 -0700 (PDT) X-Received: by 10.223.142.13 with SMTP id n13mr18888063wrb.133.1521737585167; Thu, 22 Mar 2018 09:53:05 -0700 (PDT) Received: from faustaspc.lifodas.local ([213.197.143.19]) by smtp.gmail.com with ESMTPSA id s49sm9216789wrc.95.2018.03.22.09.53.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Mar 2018 09:53:04 -0700 (PDT) From: Faustas Azuolas Bagdonas To: swupdate@googlegroups.com Cc: Faustas Azuolas Bagdonas Subject: [swupdate] [PATCH] Added update description field support. Date: Thu, 22 Mar 2018 18:52:20 +0200 Message-Id: <1521737540-6888-1-git-send-email-afaustas@gmail.com> X-Mailer: git-send-email 2.7.4 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=o0Ssf6BA; spf=pass (google.com: domain of afaustas@gmail.com designates 2a00:1450:400c:c0c::242 as permitted sender) smtp.mailfrom=afaustas@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE 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: , These modifications adds a support of a description field in sw-description. This field is optional. Example of sw-description file beginning: software = { version = "0.1.0"; description = "This update adds a new feature and includes important bug fixes." # <-- This is a new field added by this modification. hardware-compatibility: [ "1.0", "1.2", "1.3"]; <...> Signed-off-by: Faustas Azuolas Bagdonas --- include/globals.h | 1 + include/swupdate.h | 1 + parser/parser.c | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/include/globals.h b/include/globals.h index 9e0c2b9..25d2a2e 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 09e81d5..a766951 100644 --- a/include/swupdate.h +++ b/include/swupdate.h @@ -123,6 +123,7 @@ struct swupdate_global_cfg { struct swupdate_cfg { char name[SWUPDATE_GENERAL_STRING_SIZE]; + char description[SWUPDATE_UPDATE_DESCRIPTION_STRING_SIZE]; char version[SWUPDATE_GENERAL_STRING_SIZE]; char software_set[SWUPDATE_GENERAL_STRING_SIZE]; char running_mode[SWUPDATE_GENERAL_STRING_SIZE]; diff --git a/parser/parser.c b/parser/parser.c index c8a51e2..d305e95 100644 --- a/parser/parser.c +++ b/parser/parser.c @@ -623,6 +623,15 @@ int parse_cfg (struct swupdate_cfg *swcfg, const char *filename) strncpy(swcfg->version, str, sizeof(swcfg->version)); 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); + } + snprintf(node, sizeof(node), "%s.embedded-script", NODEROOT); if (config_lookup_string(&cfg, node, &str)) {