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:
parent
fc5923d975
commit
172fc40f61
|
@ -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")
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue