From patchwork Wed Aug 16 09:56:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frieder Schrempf X-Patchwork-Id: 1821752 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::33c; helo=mail-wm1-x33c.google.com; envelope-from=swupdate+bncbaabb4526ktamgqewj5in4i@googlegroups.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20221208 header.b=iNxMfROp; dkim-atps=neutral Received: from mail-wm1-x33c.google.com (mail-wm1-x33c.google.com [IPv6:2a00:1450:4864:20::33c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RQk7v2QQfz1xrX for ; Wed, 16 Aug 2023 19:57:14 +1000 (AEST) Received: by mail-wm1-x33c.google.com with SMTP id 5b1f17b1804b1-3fe216798e9sf41772015e9.3 for ; Wed, 16 Aug 2023 02:57:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1692179829; cv=pass; d=google.com; s=arc-20160816; b=Vz88tXS4R5aHwJWDyHDBET11U3t+CFfhNfa5Gi+k6FrwJM3AuovvCSbYRNtbe+1Gei 0jzunwYPb/AlOwGMFw53fHriDUCN+CVoGfbqS9pUKMPsRSDgMKkrYL6SEDKwjnLSLfyu Mmcz0dIJ+NEkS0tvTPCu+rAG98oixNgZzV1rSuXgEIVf9pCzgM6Agi5avXQepXTA57IA GfZjt7+AeY9NEoTm6wZ1xE3YrOM/2LRzmxctLPmFHOaBg5acAEBEWMGDlNiqhhwPZhbL pwukxjRKcAT+z8FjXzlmabQd4CtY281BDjfWIeRmtB+mSEz+zCzImaya7OdS7yzkvDwb ut0g== 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:reply-to:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=hZW5mQsYRAsMav5hj7qAk9sG91O0/SvRt/NP1BJVI10=; fh=pMWz36r3hKwMh+hqDs5eWFjRRtQisXyQ5NxnWOIhhE8=; b=n1fJUPPKROPP249FVUYDcC59x8SfjdbDjWgs8gXdChi6B6m72HH9A7V+b9HxCCoYcC 74SYw5+vkt5EpVYk8YKY56rPVlaUq2v7j61+XzMs2PCgaSGfHJUra6j7N0z+n19BXGwc ADqkGHcPhnNyN1s8IRInIX8Xde4TeIXIpLb4hcF0VDqGQ6a0QucddT3t3QqCrPyXPOuh lr7NB0WukwZKB+d7+/htPS0zqGJDMSIQ0EFGTzzg9mnzIhy7cU7YxD1GmpI9x5ndesgx lTlgkLMMgQ40HyVDfibs70XnrrAqzelI4SBq41fvVJAoLwoyRZ4rr9gBaYMmPnguw1Uv QN3g== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@fris.de header.s=dkim header.b=XvsTNA4y; spf=pass (google.com: domain of frieder@fris.de designates 116.203.77.234 as permitted sender) smtp.mailfrom=frieder@fris.de; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fris.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1692179829; x=1692784629; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=hZW5mQsYRAsMav5hj7qAk9sG91O0/SvRt/NP1BJVI10=; b=iNxMfROpjRZXBeHU9AxHOPUgo2dHTJyUfEXq8bxQtuKXavGLC4mBvpfEMya6WF1bac UZoWVNa3ByNYAxJjogkQsMlUbORnd0SXFvLwANl7bPwPS7/X4yGtHRSTn1NpfA5ktody 2YZBXTCpUThwOr2k4Ln5q/yBXLGHAvxkPlNqCl/iw6Q31vH/e2IK3CeKLrGQ5X7/2zrk +Qp6Yi2SZpqn2c67YvYmCBXs/3YSCpoRh6Pbx0YV16tN6/XNx/XP/t/sfBf9ICcf1VrO jtF4Ek7S1IxQOmI57g/dv890vSGvc2ZB392gMi4vq55RHXY2USNC8IRBPAZXfL6lUbFC Cs1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692179829; x=1692784629; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hZW5mQsYRAsMav5hj7qAk9sG91O0/SvRt/NP1BJVI10=; b=Pu580S3avfJiP7fGFO0MTXn8OA9MK4L3ULXLRI4eAqJZxQqOGKWAeZqmx8zN70bflX 1DqrlLXSOkoWWK3aqyyYl/hd4g8EiiScCQPZfSBaxMq0/Gvgl7v9GJj7Xg+lQuWoAFTG gvpYUD+9Rv1tpG8SsdqTSb3Pk6CkWAeZAmGxjTqNagqRJmx94mNK21nN8bX4IcGBIdw3 qDDKzQgT/Ue8SLhgVZk/t4atNk1/DceiMhTxbkB/c1JI4C2upTda7DW0NfYcobSw+Zra 0fCRLrUiYOG9qvgLsWY4wsBAnkMqBvKIxc2G0oiO/MsTJeI0gre9xhhE1yB9DQos64oG VEOQ== X-Gm-Message-State: AOJu0YwhlERZlzMOoB6OUybMrKU7ijkUENq7yqbJeHIssbh/EmHmmPE2 CxQfcmEAwMoH7G6gIydK24g= X-Google-Smtp-Source: AGHT+IH6XI1/FB0xAqW7zv8StUxpmKX1DUFukFjpYyGjvdq0MQW24+ixdkjKSyBn8YeOdVszlmydcQ== X-Received: by 2002:a7b:ca53:0:b0:3fb:d1db:545b with SMTP id m19-20020a7bca53000000b003fbd1db545bmr1090109wml.20.1692179827788; Wed, 16 Aug 2023 02:57:07 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:600c:46d2:b0:3fb:422d:4ff8 with SMTP id q18-20020a05600c46d200b003fb422d4ff8ls2313580wmo.1.-pod-prod-02-eu; Wed, 16 Aug 2023 02:57:06 -0700 (PDT) X-Received: by 2002:a05:600c:22d8:b0:3fc:3f31:4233 with SMTP id 24-20020a05600c22d800b003fc3f314233mr953821wmg.38.1692179826337; Wed, 16 Aug 2023 02:57:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692179826; cv=none; d=google.com; s=arc-20160816; b=w7Y2SmO0gkroKZjr9vWPSLq+i1kwdFzOUjHvmXSZOBX7eWt+hnn5i4L54jkCaLO6iU dgv9iikDK7a+Kg6D8jwFBQukRzaw+jl06znOjev0xf4Qdv6K3TVjZH0Htw3tb1o8N6mF Ph5EhlE7ujtn19KwXlW7060kl+xldftH6733Vgalb7hX4U8NdMmkDtnwvrTm26OirPIg +k6GIMU8DGNHZgE7kOngYCifUaA0AW+GwV2bIPRN6VeAYw9hz5SnD5luEU1Kqe0Dp+Hk KPbouiGyOUMvaZpwppmSdd9rVuOUDlN8GWMpWtx2qhBOPIxISgDkwPSTX3Til5SGD7Ql 4QiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=fs70urQXV6cvpT5VtOkcRTOTYnAlmS1aRAWMzOHZseI=; fh=CPEQwWhHQydk5h6J0pdMI3rn72u6nbFxr8+SGXDmjzI=; b=R+TjJJ1r5qKZ2z1GrYk6VS8kaQnDAxX0IVRkyll84w5bxZXF2EG5gXiuYJSZyBCP+G PRT8X53mQfLs9fOgI1s92Igx0hwXkrzSyY0ZUy0UUmkRFQ8uuzzN/shHOdLe3q5yslus JrPK0a2Bz7bwk0NAJZoMzZc9I8xgykBHvb+rclbVsItwn7sljsN5pMEYiqHdnFsyp6zk lNF5fA28J7jAeo+Whs/Dg0EagpSuB9pkTV5UfYhIqkYTsRMKEIwM8Ykx9IdTbSobQ9bw ToyjAtYa2zPFS1kZS13E7DQskx83p/VTFmH9y/tW7a9z+kADpLQBU9XE7E5g6oWviFaT FitA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@fris.de header.s=dkim header.b=XvsTNA4y; spf=pass (google.com: domain of frieder@fris.de designates 116.203.77.234 as permitted sender) smtp.mailfrom=frieder@fris.de; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fris.de Received: from mail.fris.de (mail.fris.de. [116.203.77.234]) by gmr-mx.google.com with ESMTPS id bd17-20020a05600c1f1100b003fe1c5703bdsi70918wmb.0.2023.08.16.02.57.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 02:57:06 -0700 (PDT) Received-SPF: pass (google.com: domain of frieder@fris.de designates 116.203.77.234 as permitted sender) client-ip=116.203.77.234; Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1EF90C03CA; Wed, 16 Aug 2023 11:57:05 +0200 (CEST) X-Patchwork-Original-From: "'Frieder Schrempf' via swupdate" From: Frieder Schrempf To: Stefano Babic , swupdate@googlegroups.com Cc: Frieder Schrempf Subject: [swupdate] [libubootenv][PATCH 1/3] Try to autoselect namespace based on DT property Date: Wed, 16 Aug 2023 11:56:39 +0200 Message-ID: <20230816095641.149618-2-frieder@fris.de> In-Reply-To: <20230816095641.149618-1-frieder@fris.de> References: <20230816095641.149618-1-frieder@fris.de> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-Original-Sender: frieder@fris.de X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@fris.de header.s=dkim header.b=XvsTNA4y; spf=pass (google.com: domain of frieder@fris.de designates 116.203.77.234 as permitted sender) smtp.mailfrom=frieder@fris.de; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fris.de X-Original-From: Frieder Schrempf Reply-To: Frieder Schrempf 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: , From: Frieder Schrempf The bootloader might be able to tell us where the currently used environment is located. Use the string from the "/chosen/u-boot,env-config" devicetree property as namespace selector if available. Signed-off-by: Frieder Schrempf Reviewed-by: Stefano Babic --- src/fw_printenv.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/fw_printenv.c b/src/fw_printenv.c index e475e43..6118324 100644 --- a/src/fw_printenv.c +++ b/src/fw_printenv.c @@ -87,6 +87,9 @@ int main (int argc, char **argv) { bool noheader = false; bool default_used = false; struct uboot_version_info *version; + char dt_namespace[32]; + size_t dt_ret; + FILE *fp; /* * As old tool, there is just a tool with symbolic link @@ -144,8 +147,22 @@ int main (int argc, char **argv) { fprintf(stderr, "Cannot initialize environment\n"); exit(1); } + if (namespace) ctx = libuboot_get_namespace(ctx, namespace); + else { + fp = fopen("/proc/device-tree/chosen/u-boot,env-config", "r"); + if(fp) { + dt_ret = fread(dt_namespace, 1, sizeof(dt_namespace) - 1, fp); + if (dt_ret) { + dt_namespace[dt_ret] = 0; + ctx = libuboot_get_namespace(ctx, dt_namespace); + } + + fclose(fp); + } + } + if (!ctx) { fprintf(stderr, "Namespace %s not found\n", namespace); exit (1); From patchwork Wed Aug 16 09:56:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frieder Schrempf X-Patchwork-Id: 1821750 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::139; helo=mail-lf1-x139.google.com; envelope-from=swupdate+bncbaabb4526ktamgqewj5in4i@googlegroups.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20221208 header.b=OFMVHy/g; dkim-atps=neutral Received: from mail-lf1-x139.google.com (mail-lf1-x139.google.com [IPv6:2a00:1450:4864:20::139]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RQk7v2GHbz1xrW for ; Wed, 16 Aug 2023 19:57:14 +1000 (AEST) Received: by mail-lf1-x139.google.com with SMTP id 2adb3069b0e04-4fe4a1ce065sf6372960e87.3 for ; Wed, 16 Aug 2023 02:57:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1692179829; cv=pass; d=google.com; s=arc-20160816; b=Dp5MtFmoDkwVXsGJlZwict2DwN0iBj9B5gctvC11WQo6jFV4KmbvS0BGWOBS9FkJp4 Attpz7Zbv+eCxd9qVMMRrH1SvULyp2JFamBFf+JaOQLrRDsK9+HBiUI5jVv6+LpWaAG8 R9ote9EE2/BYlcdGmbDcjvZWymA4hEM5rQh57h3DMmo2rFgjqVCi+pRluUQUMbksorg7 kYEN3KX8T2v6B/qoLTJSjHg7hXDUrK6FQyXqBrZgazA9msBT4ChO+oq0wt98hkXAjuLU w+FvOwG28jnIwODdmS+IkffztYatkhoJNb0MhtK5I3PEvSnogqW++32q4HW7OC1hvHZl Hnjg== 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:reply-to:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=jwg5metJ9ABSyXKvjpbdYDB/Pc5kd6PgRP6J39Z4Bhw=; fh=pMWz36r3hKwMh+hqDs5eWFjRRtQisXyQ5NxnWOIhhE8=; b=Csp+2bJGn5cR2LloNBI+y8zQOFoV4QJYBUCzBH2iWGZAFs508CWvZzor7pIFZNNYaB 8pRpqRtbPL3CKk3ht6AxEF+o57nEgfLJ1W5VPgtp9b/vRl9vbS7quYl4oD+rw2haAbtH rsT7tPeNZYBjUuYO6esLytsCh39vlsh0gdJM/SNP4lhNWRnlPsq0I4MG20C1M3usDXjk Mf87vMCim0mkLlkesMBdDDO1PkN1x1Z3U6cRLXlfHq9WglGuZbez6z7TkFmOa9ULV6LT w4vYltV2AbTiyBSGPlZutHs0vXJy4NDIJ8aCG6JatmbLBzDJ76x+6IZAtjaRu4N9osym BVRg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@fris.de header.s=dkim header.b=CZYjWSqM; spf=neutral (google.com: 2a01:4f8:c2c:390b::1 is neither permitted nor denied by domain of frieder@fris.de) smtp.mailfrom=frieder@fris.de; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fris.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1692179829; x=1692784629; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=jwg5metJ9ABSyXKvjpbdYDB/Pc5kd6PgRP6J39Z4Bhw=; b=OFMVHy/gz9nLiGzdoVoFTRVe5NXo/vRYkYAWyOpn5u6xETrmsvD971s8F/QWVUKNCY ptSUYGpTn8NGGI+3Rvd96p6anYm8OWwZFal5oUYfWVfQdEpAqDFcxuME2HrlJTTax+BX z1yd4Ff6rzZWvuUXLXXy85gXNsegdtKYEBReBIGa9urRRaQujupNEw7aGMx5V0rTKrBK wqssrb4LbahmUmyxx36XWVr7et2WIM6fY5JB88nFmCQA6Imdykwm4QgAigGA/Qd688vy RFYAoGc+qc7PZxsHqxgTnpq2UM6PxCa4wzWE3FItGm0Bg9nzN5oGoS9GHnFyhU1tHlB+ 5dyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692179829; x=1692784629; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jwg5metJ9ABSyXKvjpbdYDB/Pc5kd6PgRP6J39Z4Bhw=; b=dqPzJeSvZ8aZhQ+2E249csHEcXg42jFyu3SWQhXDF8yrYeoKdwT90HXmixOevYPHlj TR+bzqmEzxCfF2nESB75BWS3jL6IUAnJIH0DT7rB5pcX40zPUrmh1HOsGX6VAPVHtwr8 54T9gbuaJHz5O0NUwk4lCTztasuuKnPLaszmjSYUhxNO88Dsa+yCS8sDIEP+9e6mDyg2 u3PrrdOrLY1ih7SozuWvitsagQy4mvopv9zolTUpOl/tSNJ1ABpxDzD7fQkGWgTJzpwH NEhXiwY4tDLYsRgCGog9fBG3V3BI1a3yvqwyX6gAr9B8jZbJjLrHDoZfoOPGFS8uCsCG EAPA== X-Gm-Message-State: AOJu0YygO45vY5u9EOuENpMs3mbSO1c5FMYBi/u41KMiaNJFqqUAYmm8 B/hJdLJdaVe/evb0tIqWRTY= X-Google-Smtp-Source: AGHT+IH15g5fDLLliaNeZESOwmU6ikpTQfc2cNQWj2H7w03G6ENpSCF/JsN6aJjJIz7NhoPMl3Pzug== X-Received: by 2002:a19:3857:0:b0:4f8:5635:2cd8 with SMTP id d23-20020a193857000000b004f856352cd8mr901876lfj.32.1692179827940; Wed, 16 Aug 2023 02:57:07 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:600c:3b24:b0:3fb:b071:d165 with SMTP id m36-20020a05600c3b2400b003fbb071d165ls2571448wms.0.-pod-prod-02-eu; Wed, 16 Aug 2023 02:57:06 -0700 (PDT) X-Received: by 2002:a05:600c:c2:b0:3fe:2011:a7bf with SMTP id u2-20020a05600c00c200b003fe2011a7bfmr1061806wmm.6.1692179826336; Wed, 16 Aug 2023 02:57:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692179826; cv=none; d=google.com; s=arc-20160816; b=KjgUsZ9P0LoGbrYLxabh+S7CZnfDyxZ6FpRmS3Gf8YjSUOtFViP/+0O3+TC+VWsywl FLcV1SxnYTKx+UrbJnn/MMKW78LN7Xw7cP9pRUkCTdTBo4OBLGJcHdX/gBH10Tme5tPX TuCoB779VBL40OVY0twaKAoDOYrHEG53RnGTRVSHuLCl5zBr/Yj40HLbMICatSBSzkZf /W5E6EnVdC7oDMeydZEK/Jh5tKvfHj5FpRJ3QQ4aDd28RpV5uhIP9GP5FXCeqBy95RS/ 7ZwNswkASXzNmDgwavP5EA0qOC9Xc8II1/cZKkyqI6tGhU8sWAYiwOJje+3jJ+8/GrxH fo3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=vmYU1JGfzjioM0SrVaK4hXb5IhAaNyL6Tzl8MJPXWEs=; fh=CPEQwWhHQydk5h6J0pdMI3rn72u6nbFxr8+SGXDmjzI=; b=po9Cpxgge+WQKUE/K7IRSqPkwC61ixSE1bu+m+TftnArzS+/QI6nciBSHQTYFYzGEh W4D4dhu8FoF1UqFlaEaxEz3FvjQHQccoCgjxio2r8NcClMSyAQXBLCskQLdFMdbrLAAx rr72FsGUR1SmS/Y83W74pDvoblGAsc0oPNGLMKYjRaMRLzMBt5toWQwk6yPRXuctkzFN pf8tx2yjGy4yv673FNF5z/x4WtX/7JJLgZ0ma3DCoGiH4ymWdted+xTTWgafyING0vo5 vwwxDue5+Y9e3iXs4Vsht7/gFSKSOkV45cqp9ZMPfxL1a9+rQCKP508YW5Jzm8/UIhM1 q0xg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@fris.de header.s=dkim header.b=CZYjWSqM; spf=neutral (google.com: 2a01:4f8:c2c:390b::1 is neither permitted nor denied by domain of frieder@fris.de) smtp.mailfrom=frieder@fris.de; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fris.de Received: from mail.fris.de ([2a01:4f8:c2c:390b::1]) by gmr-mx.google.com with ESMTPS id p17-20020a05600c469100b003fe23ec4859si1346826wmo.0.2023.08.16.02.57.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 02:57:06 -0700 (PDT) Received-SPF: neutral (google.com: 2a01:4f8:c2c:390b::1 is neither permitted nor denied by domain of frieder@fris.de) client-ip=2a01:4f8:c2c:390b::1; Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 8DCEAC03CB; Wed, 16 Aug 2023 11:57:05 +0200 (CEST) X-Patchwork-Original-From: "'Frieder Schrempf' via swupdate" From: Frieder Schrempf To: Stefano Babic , swupdate@googlegroups.com Cc: Frieder Schrempf Subject: [swupdate] [libubootenv][PATCH 2/3] docs: fw_env_config.md: Limit line length Date: Wed, 16 Aug 2023 11:56:40 +0200 Message-ID: <20230816095641.149618-3-frieder@fris.de> In-Reply-To: <20230816095641.149618-1-frieder@fris.de> References: <20230816095641.149618-1-frieder@fris.de> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-Original-Sender: frieder@fris.de X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@fris.de header.s=dkim header.b=CZYjWSqM; spf=neutral (google.com: 2a01:4f8:c2c:390b::1 is neither permitted nor denied by domain of frieder@fris.de) smtp.mailfrom=frieder@fris.de; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fris.de X-Original-From: Frieder Schrempf Reply-To: Frieder Schrempf 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: , From: Frieder Schrempf Signed-off-by: Frieder Schrempf --- docs/fw_env_config.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/fw_env_config.md b/docs/fw_env_config.md index e5a75cc..ed3a8fe 100644 --- a/docs/fw_env_config.md +++ b/docs/fw_env_config.md @@ -6,8 +6,8 @@ SPDX-License-Identifier: LGPL-2.1-or-later fw_env.config Configuration File- Legacy format ================================================ -This is the configuration file for fw_{printenv,setenv} utility. It was defined in U-Boot project -and it is defined here as legacy format. +This is the configuration file for fw_{printenv,setenv} utility. It was defined +in U-Boot project and it is defined here as legacy format. Up to two entries are valid, in this case the redundant environment sector is assumed present. @@ -30,7 +30,8 @@ Entries must be separated by spaces or tabs. - Device Offset: offset from start of file or device (mandatory) - Environment Size: size of environment (in bytes) - Flash Sector Size: (optional) if not set, it is read from kernel -- Number of Sectors: (optional) number of sectors for environment (mainly used with raw NAND) +- Number of Sectors: (optional) number of sectors for environment (mainly used + with raw NAND) - Disable Lock Mechanism : (optional), 0|1, default=0 (LOCK enabled) @@ -100,8 +101,9 @@ UBI Volume by Name Example Configuration File in YAML ========================== -A YAML format is defined to allow multiple sets of variable. This lets have same features (redundancy, power-cut safe) for -environment that are not bound to the U-Boot bootloader. +A YAML format is defined to allow multiple sets of variable. This lets have same +features (redundancy, power-cut safe) for environment that are not bound to the +U-Boot bootloader. ```yaml uboot: From patchwork Wed Aug 16 09:56:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frieder Schrempf X-Patchwork-Id: 1821751 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::13e; helo=mail-lf1-x13e.google.com; envelope-from=swupdate+bncbaabb5f26ktamgqeiptg4hi@googlegroups.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20221208 header.b=mJJ4KZQT; dkim-atps=neutral Received: from mail-lf1-x13e.google.com (mail-lf1-x13e.google.com [IPv6:2a00:1450:4864:20::13e]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RQk7v1jHRz1xrV for ; Wed, 16 Aug 2023 19:57:14 +1000 (AEST) Received: by mail-lf1-x13e.google.com with SMTP id 2adb3069b0e04-4fe356c71d6sf6254408e87.1 for ; Wed, 16 Aug 2023 02:57:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1692179829; cv=pass; d=google.com; s=arc-20160816; b=b8ulgtNmqUxorF4wKLPRYI2+7DrYWhsfxgXe35TJInPmD/QR82UAUdn42JfMvdtZxf GgYHMOOWWirx5nqGrI1D5Ra2x1ENBrNKK2rwczj+jFVHGtR0bszeO0TwW/2cBKvIjyHb yPUs32EOCOeE/Ee9DCbv4xTrrJH1rOKWCtDfH2JO3IA8WYTft3/AFjqc2FSfpkuUmbQe j0gHosCQ+3KZb2ZEkvYl13E9vX3udvHwNGneM8IvsP7ehofR/yOJrSyFLsNx1onhAtwK IC36ufrYRpdnJfo3emQE+mLW1aQevGBvl1egvnWJlXqjmk8VaPitQZJW6eWNcbHd9CJm xn6A== 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:reply-to:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=oa8YvH9Z1vxI+1xUZsEbvSfCyGM3U0U6cjLcR5JiS/4=; fh=pMWz36r3hKwMh+hqDs5eWFjRRtQisXyQ5NxnWOIhhE8=; b=t19dTRYuMD0IuehbJ+K9RzVQKkGUvGZ6lFY28EmtVQhGLt3YWAAp5L/Zu6Fm0HwKAk 9jN6K3isYMnYnyMTTy+xpme1OQNS0j5CAVOzaXAWJ23Cl/PQqqk2hAAW+uVXGNq85A/E 5rRZLjSHK+Rp72Hn1GUede3+vB75r6JeGhjzEJNVG0xd++9i+APeKEwz/ankgh0dyUKJ OELACUWExew9BYacDV7I1vwu26tBcMKnEAAyzTGT69tQ5uN2peRDuwt1Yo9kUZkCih5Q 2hwW+nxoc1q+N1gxuL/SqvjBuOzaE3MG87u+zwBGqHYFAKE/w3W4jbY76BJt+rYcxyq/ MO6Q== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@fris.de header.s=dkim header.b=pcoWTdMt; spf=neutral (google.com: 2a01:4f8:c2c:390b::1 is neither permitted nor denied by domain of frieder@fris.de) smtp.mailfrom=frieder@fris.de; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fris.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1692179829; x=1692784629; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=oa8YvH9Z1vxI+1xUZsEbvSfCyGM3U0U6cjLcR5JiS/4=; b=mJJ4KZQTwrdYAAUh5au0oOmNOEjaa2BTGfWPfz0f9K+8IcD519/VsIYx5UhrMMPVqZ RnHUsnirfR9TYGZowoqrsPNBSQtKlRmfvn/FDfxXyZ5FBP6a2iHi4TN0ePFneqIc1IJD TTwGMBG7lNDeiPqRkGM0BQpEVGLNFOXqfez8IAdDJqa04d8PSxocFtXMfDRlb6R72DK0 RYHgvdhyjYByHHLFelvRp0x5gaVwf1xGRl2rx1KtiyxlU1HLe+f5ozMhwILEnquSrPZ/ MKJ1/7aHNCOBlyUnH+d1pOaaBQJVK5gSADmNZO7X/xQUVYMKkjNVC6OUjoqC1Bkp5WA2 zQag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692179829; x=1692784629; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oa8YvH9Z1vxI+1xUZsEbvSfCyGM3U0U6cjLcR5JiS/4=; b=j1Ig2FFIFdlkXG65VKkClIBVz4ODbj0yCgyFecjf20pvPnog60MQ5fUutWuYseQ8zW hz0pD7tzf/GPTR/JQbZ2O9pcHbkYWE+R/wnHTKWdgckq3tGITM74Mv+PEvEAytqIvRj4 Jb4LQ8DW2N/1Ips8Cy25daG8k7Hki4UvZ1gVx6bxCvbK6MmL3Qnf4ZwEfR632u1uCNfG oCSlbirTTh/gIa/X51tBE8AJGky8k1ZQoo9YFkLdCIaOfOSS7sH3jmThhzhDS271kw9x WWmz3dnMYSqSG1/wO0v61UxtW27NJGPm8k3i9iZLbtmVr+OiSWnHplDJzkbSF6qbxP7B NBcA== X-Gm-Message-State: AOJu0Yyb78MXa/SOLnW34to5EenzW3OouBPW39bU5IfnryKH8Oy4h1N7 LIabWaibECsPNYjzdPnyo+s= X-Google-Smtp-Source: AGHT+IHw0AXCkxrSfBEyC6Yv49TDHqryPJnHytAggsAF11v6+E4m5i9DW8Zgkkl5qnRdilZHERW1VQ== X-Received: by 2002:a05:6512:10c5:b0:4f7:66bf:b263 with SMTP id k5-20020a05651210c500b004f766bfb263mr1405363lfg.24.1692179828572; Wed, 16 Aug 2023 02:57:08 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a19:381b:0:b0:4fe:28f1:9bff with SMTP id f27-20020a19381b000000b004fe28f19bffls383241lfa.2.-pod-prod-07-eu; Wed, 16 Aug 2023 02:57:07 -0700 (PDT) X-Received: by 2002:a05:6512:2096:b0:4fa:ad2d:6c58 with SMTP id t22-20020a056512209600b004faad2d6c58mr994342lfr.61.1692179826871; Wed, 16 Aug 2023 02:57:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692179826; cv=none; d=google.com; s=arc-20160816; b=bpKFfoQ0mk4zq+vXdWagO/Y+pK4GNC4q0WI4lOPHfMt8vZXAL5Ux40sEicmYagIXQB tPK7P1AI0MdDw3cV/6T1m7A2n8253uxUBAqmBFes6iohuQ0ahz/TnYGj2Zj1+TbG5qK3 03BgmucOX5RyQyjtmNdVOJkGT24Ls54ohAY4vZV0AR1xsr+TukYfPdLMH8GlonxbQXuJ q1ODdBLLMFTIkNJr9a+Gflp8JiqOcJlrlwdwPr1ZH6aTa/KGZt8ktOilETKjZ+kCzIzL VBb8OQwtVUZPa5IQBGzdgtgeR3lbnyk8sR91AVIDxkKouE6ayyqgse+grC6G9ZV7X245 04rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=kRjRqx1wWY6VmdrVlHj8dGN5fBqM7RilGq/axTyP1/k=; fh=CPEQwWhHQydk5h6J0pdMI3rn72u6nbFxr8+SGXDmjzI=; b=XrwkExrwSxfJ/imV31/N5ccTMKg/tLpIUvjrGLW3Zx84oNu22DSy6F0k3uK5lkBpd4 uTEAXAUtrnLHKO//Dc4aemBz/i+kJMIFZB7w7cuupjyJm9ZSRHn7ZUOgNG/k3Us2Yfp3 ZP2tebnoKAYx1PHvwVgNl7XOfrBqgogeys0Uh4/piTKCwOat7X753JWpRPE+2hi57MN1 UOK2BbtWIjEd88D9fIofXUGYwCWd2/L4fyLBF8wJ0Ja+ejZin759/IeO8rf2DT8NKebW v13Zl/E9Lpx36OeYBGa95EoyOxdVtZWqXrGbZHx98+UYAEkUQ4SEkJmY+DnBhiIVBYdi eohA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@fris.de header.s=dkim header.b=pcoWTdMt; spf=neutral (google.com: 2a01:4f8:c2c:390b::1 is neither permitted nor denied by domain of frieder@fris.de) smtp.mailfrom=frieder@fris.de; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fris.de Received: from mail.fris.de ([2a01:4f8:c2c:390b::1]) by gmr-mx.google.com with ESMTPS id ay10-20020a05600c1e0a00b003fe16346f74si1214495wmb.0.2023.08.16.02.57.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 02:57:06 -0700 (PDT) Received-SPF: neutral (google.com: 2a01:4f8:c2c:390b::1 is neither permitted nor denied by domain of frieder@fris.de) client-ip=2a01:4f8:c2c:390b::1; Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 0DAB6C03CC; Wed, 16 Aug 2023 11:57:06 +0200 (CEST) X-Patchwork-Original-From: "'Frieder Schrempf' via swupdate" From: Frieder Schrempf To: Stefano Babic , swupdate@googlegroups.com Cc: Frieder Schrempf Subject: [swupdate] [libubootenv][PATCH 3/3] docs: fw_env_config.md: Add info about namespace selection in YAML config Date: Wed, 16 Aug 2023 11:56:41 +0200 Message-ID: <20230816095641.149618-4-frieder@fris.de> In-Reply-To: <20230816095641.149618-1-frieder@fris.de> References: <20230816095641.149618-1-frieder@fris.de> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-Original-Sender: frieder@fris.de X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@fris.de header.s=dkim header.b=pcoWTdMt; spf=neutral (google.com: 2a01:4f8:c2c:390b::1 is neither permitted nor denied by domain of frieder@fris.de) smtp.mailfrom=frieder@fris.de; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fris.de X-Original-From: Frieder Schrempf Reply-To: Frieder Schrempf 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: , From: Frieder Schrempf Signed-off-by: Frieder Schrempf --- docs/fw_env_config.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/fw_env_config.md b/docs/fw_env_config.md index ed3a8fe..17b17fb 100644 --- a/docs/fw_env_config.md +++ b/docs/fw_env_config.md @@ -105,6 +105,12 @@ A YAML format is defined to allow multiple sets of variable. This lets have same features (redundancy, power-cut safe) for environment that are not bound to the U-Boot bootloader. +A set is selected by using the `-m/--namespace` argument. In case the bootloader +tells us where the environment is located by setting the +`/chosen/u-boot,env-config` property in the devicetree, `fw_printenv/fw_setenv` +automatically uses the string from this property as a selector for the namespace +in the YAML config file. + ```yaml uboot: size : 0x4000