From patchwork Mon Nov 1 18:12:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Domenico Andreoli X-Patchwork-Id: 1549266 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=p0niukr3; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::13a; helo=mail-lf1-x13a.google.com; envelope-from=swupdate+bncbdkkzrnu3aerbn64qcgamgqeq46kgoi@googlegroups.com; receiver=) Received: from mail-lf1-x13a.google.com (mail-lf1-x13a.google.com [IPv6:2a00:1450:4864:20::13a]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hjh3d1kshz9sRN for ; Tue, 2 Nov 2021 05:13:15 +1100 (AEDT) Received: by mail-lf1-x13a.google.com with SMTP id bq29-20020a056512151d00b003ffce2467adsf6299640lfb.3 for ; Mon, 01 Nov 2021 11:13:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1635790391; cv=pass; d=google.com; s=arc-20160816; b=d9c+OP1WYasaGIDFLgIA96Ye/HFCbBsw0CkL9NQ3pMKvir0LCoX3Vrkzup0vOP8aZ5 G+kpIHV3bPEZkL8RutehamxYNW4PkduAYAHgouYmxnysM1nuWaSrANbr4ohsuu44dOvo au6YEhlqlDLNbrPP9A+p8Cq2yQrZhifmNsiVL+p05F485UsAB74k1ITaab0xhXWVG88q O9WsCavLff6azqmqv1i8e5XTf+1wi9UgQVNYrtRoOAcgBkFAtJyk3X0pvx8lH7x/dGgS ovd5cD80+8KvEwx+ocJb9Hfdd0q0KjtmLmpPXCJM0SIPXRpXD4qfZ33SrwVpsJGqI3sx Axcw== 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:content-disposition:mime-version :message-id:subject:to:from:date:sender:dkim-signature; bh=hvMSYm11pL+J1q6g1SlRDrSIpfaw2eP6YH041cwPU6I=; b=qFvI6sw83d6bQKIJpa+PTe60BTxsX1CTAXn2z5Q0d41pZIuRsBsAKwjO/TJK9MYyun /D5dAZ3MtEUWbC0MK0tntpyMamJLQfDfYtfKahqXqWefkCdk+yxDLX32g4cxhD6FuLkW bfKW5NxOHz6HHmKhaLaC8CkKzpgnaZCAu7b8QH1d7db6EqPMjHwgoKkMS4ZCgnhaUtGk yLkBhX++pAmKtSQTmHs68KzzZ/SQjqotqb/pxzZs4/3hyGZS7wB3I5pX/hRdh8KK1mhe MuiqUNMVX7Bg05nR9K5M3WY2nTzisyel5eFvofezck39t+3WYwkisjz9p8/fcNREf74Y bjrw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=koRbt4Zj; spf=pass (google.com: domain of domenico.andreoli.it@gmail.com designates 2a00:1450:4864:20::52a as permitted sender) smtp.mailfrom=domenico.andreoli.it@gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:subject:message-id:mime-version :content-disposition:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=hvMSYm11pL+J1q6g1SlRDrSIpfaw2eP6YH041cwPU6I=; b=p0niukr3nLWKX8LrwVrLtwALR6afiAebYUZ/Z1JJ6qzNddEcjp8yIkbGW5xWl7P/Jv LQWO5yIt6Py/iqSmaHrix9n0SJJKEDlAMf/mbq9IsbUn8PXcNhmT0+Y/TBPl4MXyNKGX XtvjKNwbyOjgGU3OMRne/LFgvM6m7UMgLFLXeSm6paL91A39Gi3Q8IT8QXAXaROpw3V2 c9C6PnupeUa08lSgxTSUhXNj/esc7J0SYqwPwgMy2ymkvnDp7SwXfaRSx/p/i0uKH/kR gNKUEUKa+W6M429EGsfEAzml9OFFq7ec1ZIqPmedyAFKCShtTRS5IhQ68wxVM5nOkotd 8oOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:subject:message-id :mime-version:content-disposition: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=hvMSYm11pL+J1q6g1SlRDrSIpfaw2eP6YH041cwPU6I=; b=5mhG9gt5pAlKZz47qsrNF0dL5Z3l9BxvSgtKuoIWZPv13fSTCAoK+oSxaRcMnl24Jm zjFlA0Bi3lxt/mgXI3AtRLXEvpfCnJ0s0s7+jTJ2MTPiOpQmEnPqRi6FDeWmxjkXWH3i ruvXu3D3bkReUvMu1ktANKWHTW225LAGK4cez6vzjQ3mmmfXuomLd+q9UB9jRD3dNIGP NE75GVb0OmII7ptfMGZYGYO8OURM6U7AVObd0Renso2nhwwxDQe9b7U366iCeIpGpM4v qVeRKuPxklc/WAIobtfXx4jSqIfp++dUoafQQrqBxJMEAWP3Ut/A4EqKX7FSV3wAuVPm goww== X-Gm-Message-State: AOAM532qqz0Zz2n1tjRac3s15tU9cc4GaTsasT//dcJQ8eN17cfeSiCq Cv72TonMVguLKjFQsT4qZv8= X-Google-Smtp-Source: ABdhPJwxbunjjWgfiYCKcqL+8g3QlJzw5EVAw6TsFh4SjvqAXN448PDZvoqYW2TYFH4KTlOqzofk6g== X-Received: by 2002:ac2:4347:: with SMTP id o7mr18522562lfl.139.1635790391523; Mon, 01 Nov 2021 11:13:11 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a19:c74d:: with SMTP id x74ls1597780lff.3.gmail; Mon, 01 Nov 2021 11:13:10 -0700 (PDT) X-Received: by 2002:ac2:4104:: with SMTP id b4mr18056574lfi.130.1635790390442; Mon, 01 Nov 2021 11:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635790390; cv=none; d=google.com; s=arc-20160816; b=cXjL5tNFsmlEVSYkfaxT1B9cKU4JhvwWhq8bJ3qyHd8TWE43sbUnG9LfhvJulzDV1a i2ulgRxtcvAyFRvUhgbiatoFBT3I+CA03I/mJr3gr/FXOwLUyqyb0jrFbdku0ES86qNA mlGYNZqGPsuG7NvQVmcLztiN/cxar3DggEMjI6VVAMU3WkBJet9BmVkRpLnmGw3XVr2p mJ88Ta6yKEeN2Vj9KXPjSpWBn1blQbs42H2uxcGxb9vsiN+ZyNQoejnMJ+piYczrXmqZ 3pYjZ/BJges3XEzTnugOVeoOmNX6ki4sgm4IaGJCy/AiX0haWMGfGjWHWDfjqSwgjhOy BOrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:message-id:subject:to:from:date :sender:dkim-signature; bh=qnOq/KVFtoKUK7Tbm9FB4F7vWDYbExsIiLTk2qP7sTs=; b=Z22Bvrk1qSEMi0Cm2vy6fsIKrI2owhi4pIODLc2c+D/PXomD+p8FT4NVISeP5jQ1EH vjWLGcgWg9T1cnu9aQF0aTgY6DiAdL3cFHuAXOefRSR0rzzd6LgFSaXZJxFqPRrikJGB DlQGb+nO99FvxoMJO/aB8C4o3gWhMCKnwSM4coq/3o9IdUGf3PzPJM7FnvendEarvume KhPGSb4RTTLk/3aAHT0q9IojIQgb3N3H+Ca75mpAqc+OmGhzZriSqJvJvbXvoyVmoqeV JjVAwVeQx2165YkVemYgnAds8A6Pc3MPFGxicQ3rUY/pz6B3ztoozZIfkZ5Xbm9r6Etd aJEA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=koRbt4Zj; spf=pass (google.com: domain of domenico.andreoli.it@gmail.com designates 2a00:1450:4864:20::52a as permitted sender) smtp.mailfrom=domenico.andreoli.it@gmail.com Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com. [2a00:1450:4864:20::52a]) by gmr-mx.google.com with ESMTPS id h4si874328lft.8.2021.11.01.11.13.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Nov 2021 11:13:10 -0700 (PDT) Received-SPF: pass (google.com: domain of domenico.andreoli.it@gmail.com designates 2a00:1450:4864:20::52a as permitted sender) client-ip=2a00:1450:4864:20::52a; Received: by mail-ed1-x52a.google.com with SMTP id w15so67320240edc.9 for ; Mon, 01 Nov 2021 11:13:10 -0700 (PDT) X-Received: by 2002:a17:907:160b:: with SMTP id hb11mr20525989ejc.336.1635790389831; Mon, 01 Nov 2021 11:13:09 -0700 (PDT) Received: from q1 ([185.220.102.243]) by smtp.gmail.com with ESMTPSA id g19sm217327edb.69.2021.11.01.11.13.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 11:13:09 -0700 (PDT) Sender: Domenico Andreoli Received: from cavok by q1 with local (Exim 4.94.2) (envelope-from ) id 1mhbnW-0000sA-TC for swupdate@googlegroups.com; Mon, 01 Nov 2021 19:12:43 +0100 Date: Mon, 1 Nov 2021 19:12:32 +0100 From: Domenico Andreoli To: swupdate@googlegroups.com Subject: [swupdate] [PATCH v2] Add description of the fw_setenv script syntax Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Original-Sender: domenico.andreoli.it@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=koRbt4Zj; spf=pass (google.com: domain of domenico.andreoli.it@gmail.com designates 2a00:1450:4864:20::52a as permitted sender) smtp.mailfrom=domenico.andreoli.it@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: , Add description of the fw_setenv script syntax v2: * mention that lines without '=' are ignored * remove the incompatibily note * aligned README.md with the usage help of fw_setenv * mention that part of the original U-Boot syntax is not supporte * add --help and --version in the usage help messages Signed-off-by: Domenico Andreoli --- README.md | 15 +++++++++++++-- src/fw_printenv.c | 16 ++++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) Index: b/src/fw_printenv.c =================================================================== --- a/src/fw_printenv.c +++ b/src/fw_printenv.c @@ -38,10 +38,10 @@ static void usage(char *program, bool se fprintf(stdout, "Usage %s [OPTION]\n", program); fprintf(stdout, - " -h, : print this help\n" + " -h, --help : print this help\n" " -c, --config : configuration file (old fw_env.config)\n" " -f, --defenv : default environment if no one found\n" - " -V, : print version and exit\n" + " -V, --version : print version and exit\n" ); if (!setprogram) fprintf(stdout, @@ -50,6 +50,18 @@ static void usage(char *program, bool se else fprintf(stdout, " -s, --script : read variables to be set from a script\n" + "\n" + "Script Syntax:\n" + " key=value\n" + " lines starting with '#' are treated as comment\n" + " lines without '=' are ignored\n" + "\n" + "Script Example:\n" + " netdev=eth0\n" + " kernel_addr=400000\n" + " foo=empty empty empty empty empty empty\n" + " bar\n" + "\n" ); } Index: b/README.md =================================================================== --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ Replacement old tools Part of the library are the replacement of the "fw_printenv / fw_setenv" tools that can be used with any board - they accept as parameter a file as initial environment if none is found -on the persistent storage. The syntax for the file and for the data configuration file -is the same as the one described in the U-Boot project. +on the persistent storage. The syntax for the data configuration file is the same as the one +described in the U-Boot project whilst the syntax of the script file is a subset of the original one. :: @@ -36,6 +36,17 @@ is the same as the one described in the -V, : print version and exit -s, --script : read variables to be set from a script + Script Syntax: + key=value + lines starting with '#' are treated as comment + lines without '=' are ignored + + Script Example: + netdev=eth0 + kernel_addr=400000 + foo=empty empty empty empty empty empty + bar + License -------