9
0
Fork 0

bootm: move globalvars from command to common

The globalvars should be available even if the bootm command
is not directly present.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2013-09-22 12:57:13 +02:00
parent fc5923d975
commit 172fc40f61
2 changed files with 16 additions and 14 deletions

View File

@ -158,20 +158,6 @@ err_out:
return 1;
}
static int bootm_init(void)
{
globalvar_add_simple("bootm.image", NULL);
globalvar_add_simple("bootm.image.loadaddr", NULL);
globalvar_add_simple("bootm.oftree", NULL);
if (IS_ENABLED(CONFIG_CMD_BOOTM_INITRD)) {
globalvar_add_simple("bootm.initrd", NULL);
globalvar_add_simple("bootm.initrd.loadaddr", NULL);
}
return 0;
}
late_initcall(bootm_init);
BAREBOX_CMD_HELP_START(bootm)
BAREBOX_CMD_HELP_USAGE("bootm [OPTIONS] image\n")
BAREBOX_CMD_HELP_SHORT("Boot an application image.\n")

View File

@ -16,6 +16,8 @@
#include <fs.h>
#include <malloc.h>
#include <memory.h>
#include <globalvar.h>
#include <init.h>
static LIST_HEAD(handler_list);
@ -322,3 +324,17 @@ err_out:
return ret;
}
static int bootm_init(void)
{
globalvar_add_simple("bootm.image", NULL);
globalvar_add_simple("bootm.image.loadaddr", NULL);
globalvar_add_simple("bootm.oftree", NULL);
if (IS_ENABLED(CONFIG_CMD_BOOTM_INITRD)) {
globalvar_add_simple("bootm.initrd", NULL);
globalvar_add_simple("bootm.initrd.loadaddr", NULL);
}
return 0;
}
late_initcall(bootm_init);