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 56CEBC433EF for ; Tue, 19 Oct 2021 15:11:21 +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 7675761175 for ; Tue, 19 Oct 2021 15:11:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7675761175 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nic.cz 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 C43FB8119C; Tue, 19 Oct 2021 17:11:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz 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; secure) header.d=nic.cz header.i=@nic.cz header.b="bV7JWsuX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 928BD82DA1; Tue, 19 Oct 2021 17:11:15 +0200 (CEST) Received: from mail.nic.cz (lists.nic.cz [217.31.204.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A50F18119C for ; Tue, 19 Oct 2021 17:11:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.behun@nic.cz Received: from thinkpad (unknown [172.20.6.87]) by mail.nic.cz (Postfix) with ESMTPSA id 1066314059C; Tue, 19 Oct 2021 17:11:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1634656268; bh=wLHxRNPPuPwD0dHhwq3V7s19Hjz2y7lePLMfQpiunsE=; h=Date:From:To; b=bV7JWsuXygKcNNiC1C2XlhY8oxucW+3LgdmIjGnNj7jDOVXGVQOLZ1Z9vYXumdgvv PBMa+DhC1jd9Jsxqec3vlCN+ijLJm5nzgAMykDo4xw9qorXT8jVyypmqAe96MohOBd JOzbvEOMrFZeMgvT7hWhhrV7U5CwIN+sE1KQ6/sU= Date: Tue, 19 Oct 2021 17:11:07 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Simon Glass Cc: U-Boot Mailing List , Rasmus Villemoes , Heinrich Schuchardt , Wolfgang Denk , Tom Rini , Joe Hershberger Subject: Re: [PATCH v8 4/8] env: Allow U-Boot scripts to be placed in a .env file Message-ID: <20211019171107.79e5d84d@thinkpad> In-Reply-To: <20211018121315.v8.4.Ie78bfbfca0d01d9cba501e127f446ec48e1f7afe@changeid> References: <20211018181322.1181847-1-sjg@chromium.org> <20211018121315.v8.4.Ie78bfbfca0d01d9cba501e127f446ec48e1f7afe@changeid> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 On Mon, 18 Oct 2021 12:13:18 -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 Reviewed-by: Marek Beh=C3=BAn Tested-by: Marek Beh=C3=BAn Tested on Turris Omnia, but we use distroboot, so will convert only after distroboot is supported.