mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
cmd: env: add env load command
Add the new command env load to load the environment from the current location gd->env_load_prio. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
This commit is contained in:
committed by
Tom Rini
parent
466d9855d4
commit
0115dd3a6a
28
env/env.c
vendored
28
env/env.c
vendored
@@ -230,6 +230,34 @@ int env_load(void)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
int env_reload(void)
|
||||
{
|
||||
struct env_driver *drv;
|
||||
|
||||
drv = env_driver_lookup(ENVOP_LOAD, gd->env_load_prio);
|
||||
if (drv) {
|
||||
int ret;
|
||||
|
||||
printf("Loading Environment from %s... ", drv->name);
|
||||
|
||||
if (!env_has_inited(drv->location)) {
|
||||
printf("not initialized\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
ret = drv->load();
|
||||
if (ret)
|
||||
printf("Failed (%d)\n", ret);
|
||||
else
|
||||
printf("OK\n");
|
||||
|
||||
if (!ret)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
int env_save(void)
|
||||
{
|
||||
struct env_driver *drv;
|
||||
|
Reference in New Issue
Block a user