From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFD2AC433EF for ; Tue, 19 Oct 2021 14:07:24 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5871060184 for ; Tue, 19 Oct 2021 14:07:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5871060184 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CD9D182006; Tue, 19 Oct 2021 16:07:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="Zp9nHSBN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3E2E481F0B; Tue, 19 Oct 2021 16:07:19 +0200 (CEST) Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1BB3C82006 for ; Tue, 19 Oct 2021 16:07:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x82a.google.com with SMTP id b12so43168qtq.3 for ; Tue, 19 Oct 2021 07:07:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rn2IpAzSxxOkC4n/MV+TuuLks/6JXt7AzenDP5RSbJs=; b=Zp9nHSBNtV9K68Y8QDYSbM+lV/lXmAYD4i9jIj5Qht3lbYhxHmhYBkmPzDSgGIx2kB jE9TcZYswE2HPtVB4VoIjnt8grVL8ElIbpDEmmAyJUEt/WKNw/7WAphpBVWPvNT4X59K kPsgzm/K1w54BGnK1gUV7wx/gSUSq4jTHf24o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rn2IpAzSxxOkC4n/MV+TuuLks/6JXt7AzenDP5RSbJs=; b=3GqywBgUIe092TaN6+kwXc14XLYlHfZVSU0od6dBAVqk4w/zxlhyjjkeIXbCxDA6T4 eHQQw0GC1VVyVJSbyWdn6lHeecvrRk5OA00DU0V5GV3IiBfytzCIgmAx86i/rbi7d7Lw cCnlUlqrzzAZnzegw55BAUyU8QrTxPeDNBds0dtU5k2znJQElq/1rgtWySACON68uHsd l+nxDNZ/T8CB7TVLfgZQ+HHAqqBuEv8BwUvD96MT5yleGJyhQnszbsF+QBxqh+hI38Ba Ayz48ooG9Bf+fx8MeRV17Hkk3VORmbqeJMosgR2aeIhg5ns9PV+QB+RVnk9cIk/6AWPP hNVw== X-Gm-Message-State: AOAM531mnaoyEibSujCoZnVzTj6wJkpmVDzuSb51fsmiYL/F+C3QyYgm mqfOuWvw9RenPT2XWvle89ISjw== X-Google-Smtp-Source: ABdhPJyHqwpKNhcrptUy3fgCjlTH28d76An4RRCly17AKNZEjk1pmLmgDAj7vlNS1agyH2qiPVy6Uw== X-Received: by 2002:a05:622a:44b:: with SMTP id o11mr68998qtx.359.1634652433600; Tue, 19 Oct 2021 07:07:13 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-b5ac-d4ae-96e7-5d3d.res6.spectrum.com. [2603:6081:7b01:cbda:b5ac:d4ae:96e7:5d3d]) by smtp.gmail.com with ESMTPSA id e13sm8124223qkm.81.2021.10.19.07.07.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Oct 2021 07:07:12 -0700 (PDT) Date: Tue, 19 Oct 2021 10:07:11 -0400 From: Tom Rini To: Simon Glass Cc: U-Boot Mailing List , Rasmus Villemoes , Heinrich Schuchardt , Wolfgang Denk , Joe Hershberger Subject: Re: [PATCH v8 4/8] env: Allow U-Boot scripts to be placed in a .env file Message-ID: <20211019140711.GC7964@bill-the-cat> References: <20211018181322.1181847-1-sjg@chromium.org> <20211018121315.v8.4.Ie78bfbfca0d01d9cba501e127f446ec48e1f7afe@changeid> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="MMiCO0L8PThUMX+y" Content-Disposition: inline In-Reply-To: <20211018121315.v8.4.Ie78bfbfca0d01d9cba501e127f446ec48e1f7afe@changeid> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --MMiCO0L8PThUMX+y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 18, 2021 at 12:13:18PM -0600, Simon Glass wrote: > At present U-Boot environment variables, and thus scripts, are defined > by CONFIG_EXTRA_ENV_SETTINGS. It is painful to add large amounts of text > to this file and dealing with quoting and newlines is harder than it > should be. It would be better if we could just type the script into a > text file and have it included by U-Boot. >=20 > Add a feature that brings in a .env file associated with the board > config, if present. To use it, create a file in a board/ > directory, typically called .env and controlled by the > CONFIG_ENV_SOURCE_FILE option. >=20 > The environment variables should be of the form "var=3Dvalue". Values can > extend to multiple lines. See the README under 'Environment Variables:' > for more information and an example. Note that environment variables may > not end in + but can start with other strange characters, including > underscore, comma and slash. >=20 > In many cases environment variables need access to the U-Boot CONFIG > variables to select different options. Enable this so that the environment > scripts can be as useful as the ones currently in the board config files. > This uses the C preprocessor, means that comments can be included in the > environment using /* ... */ >=20 > Also support +=3D to allow variables to be appended to. This is needed wh= en > using the preprocessor. >=20 > Signed-off-by: Simon Glass As much as I and others appreciate that you've written the parser here in a classic UNIX tool, awk, since a lot of the problems also seem to stem from having the parser be able to handle previously valid environment variables, if this was written in Python say, would we have this problem? --=20 Tom --MMiCO0L8PThUMX+y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmFu0QgACgkQFHw5/5Y0 tyw13Av/b2M6A/FDPkxfT8N+kjxd02XaV5h2CkrNUoICYqkgWjieI/XsHmltAPfT FYsHHnLXlaJ1//LGAHCayGulfjTW91meuwAbv7hneGgoO+68DSWPzmjIY+rkzKAU 0CHSUxGYPcB/eLh9ZEMzDRII4X5aHFGJUr6vcrgy8DG2SagYL8CaVzQru3qnvKxM NEmFmX6lgQ9C0r52DalBf08k7aLv3DFcTSXokUyLf9HosEpeuUnxsW0zsX3oYHwG Aek9IMliz+kiK7TWgkT+qojRrPDRrWMzBF7SwiDTtqKYUdWKwcxHA9o2wiwzvRqU MV4i0a3tbtFjyIaHB+372Sbrgg+NX2uB7EWBZideV4ZDu2e9tCdNFLVfPHbJkuqS hg5NYdLyqXR2Bi9v1v8sapicFH0/uN3lyE3pS4PBRuDCm1l+OxWZ2r8ncE8EUaVV V4QpSXKDn7TVSFxcjnrfYvFpZXCqpR91lL+xzT34XmKvDnk9o1oBSgbu8BbJBf5A RLuMjcr5 =XJgr -----END PGP SIGNATURE----- --MMiCO0L8PThUMX+y--