Re: [PATCH] Allow usage of default environment without environment file storage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Albert,

On Mon, Sep 23, 2019 at 08:33:20AM +0200, Albert Schwarzkopf wrote:
> Currently, the default environment is only used when the
> barebox environment on the persistent store is not valid
> or when ENVFS_FLAGS_FORCE_BUILT_IN is set in the super block.
> 
> However, ENVFS_FLAGS_FORCE_BUILT_IN can be cleared and the
> environmnet variables in the persistent store will be
> used again. This may not be desirable.
> 
> This patch allows building CONFIG_DEFAULT_ENVIRONMENT
> independent of CONFIG_ENV_HANDLING. This can be useful
> if you never want to load or write values from the
> persistent store and you only need to read environment variables
> from your default environment.
> 
> If CONFIG_ENV_HANDLING is not set, a message will be printed to the
> user indicating that changes to non-volatile variables won't be
> persisted.

I understand what you want to archieve, but your patch currently
introduces too many new #ifdefs in a code that has too many of them
already. This has to be cleaned up before I can merge this.

> diff --git a/common/Makefile b/common/Makefile
> index a284655fc..d4528bb5c 100644
> --- a/common/Makefile
> +++ b/common/Makefile
> @@ -26,6 +26,7 @@ obj-$(CONFIG_CONSOLE_SIMPLE)	+= console_simple.o
>  obj-y				+= console_countdown.o
>  obj-pbl-$(CONFIG_DDR_SPD)	+= ddr_spd.o
>  obj-$(CONFIG_ENV_HANDLING)	+= environment.o
> +obj-$(CONFIG_DEFAULT_ENVIRONMENT) += environment.o

So this file is compiled when CONFIG_ENV_HANDLING or
CONFIG_DEFAULT_ENVIRONMENT is set. At the same time the file has #ifdef
CONFIG_ENV_HANDLING in it. This might indicate that the code in this
file has to be split up into multiple files, or maybe the functions have
to be rearranged.

Regards,
  Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux