From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Simek Date: Wed, 1 Jun 2016 16:21:29 +0200 Subject: [U-Boot] [PATCH] env: Setup GD_FLG_ENV_DEFAULT flag when default environment are used In-Reply-To: References: <574C962B.2090503@suse.de> <574D1B79.7090308@xilinx.com> <3AB374BF-57F5-4D80-A2BD-A45F07CC819F@suse.de> <574D3FE8.9090404@xilinx.com> Message-ID: <574EEF69.9000401@xilinx.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 1.6.2016 16:16, Alexander Graf wrote: > > > On 31.05.16 09:40, Michal Simek wrote: >> On 31.5.2016 08:39, Alexander Graf wrote: >>> >>> >>>> Am 31.05.2016 um 07:04 schrieb Michal Simek : >>>> >>>>> On 30.5.2016 21:36, Alexander Graf wrote: >>>>> >>>>> >>>>>> On 05/30/2016 04:11 PM, Michal Simek wrote: >>>>>> Setup flag when default environment are used to be able to >>>>>> rewrite default distro boot variables based on SoC boot mode. >>>>>> >>>>>> Signed-off-by: Michal Simek >>>>>> --- >>>>>> >>>>>> I didn't find any way how to detect that default or saved variables are >>>>>> used. I want to have a flag to be able to rewrite boot_targets variable >>>>>> based on boot mode. Especially when SD boot mode is setup than SD should >>>>>> be primary boot devices, etc. >>>>>> When variables are saved boot_targets will be restored and SoC boot mode >>>>>> will be ignored. >>>>>> If you know better way how to do it, please let me know. >>>>> >>>>> You may want to be able to do the same from inside a script, so I guess >>>>> we should better have this as an environment variable itself again. >>>> >>>> Was there any environment in past? >>> >>> With again I meant "from C as well as from script". >>> >>>>> >>>>> There was a way to have environment variable reads return a value >>>>> directly from code rather than go via environment storage. I guess we >>>>> could expose the flag through that? >>>> >>>> If you expose environment variable and then run saveenv this variable >>>> will be saved and restored again and your script behaves the same. >>> >>> Not if we declare the environment variable read as callback ;). >> >> What do you mean? > > Meh, apparently I misremembered. > >> It is kind of interesting that this is not done already for others SoCs >> when you want to use distro config. :-) > > Well, there's always a first :). > > Either way, I guess your patch is perfectly fine as a first step. It > would be nice to also introduce some way for scripts to evaluate whether > the environment is the default environment, but we can always add that > later. Does this mean your Acked-by line? Cheers, Michal