Allow usage of default environment without environment file storage
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.

Move envfs functions that are needed when CONFIG_DEFAULT_ENVIRONMENT
and/or CONFIG_ENV_HANDLING is set to a new file common/envfs-core.c.

Signed-off-by: Albert Schwarzkopf <a.schwarzkopf@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 15e92d7 commit fa5b6ff16f38db14116690fbbdf031613dcc2272
@Albert Schwarzkopf Albert Schwarzkopf authored on 9 Dec 2019
Sascha Hauer committed on 11 Dec 2019
Showing 9 changed files
View
commands/nv.c
View
common/Kconfig
View
common/Makefile
View
common/envfs-core.c 0 → 100644
View
common/environment.c
View
common/globalvar.c
View
common/startup.c
View
include/envfs.h
View
scripts/bareboxenv.c