summaryrefslogtreecommitdiffstats
path: root/common/bootm.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-05-11 08:13:16 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-05-11 08:16:31 +0200
commitd323e9f6e79bbda21affa663d1974cf23979756a (patch)
treee0cbc21a8d6de6fbdba9dcf7218ff40132970974 /common/bootm.c
parent403c5169e9a1cb201a65a3165b9f98e7375d3f71 (diff)
downloadbarebox-d323e9f6e79bbda21affa663d1974cf23979756a.tar.gz
bootm: make verbosity controllable via global variable
When the bootm code is not called directly by the bootm command it is useful to control the verbosity with a globalvar. This introduces global.bootm.verbose for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/bootm.c')
-rw-r--r--common/bootm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/bootm.c b/common/bootm.c
index 66a5bf3..27d20f2 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -50,6 +50,7 @@ static struct image_handler *bootm_find_handler(enum filetype filetype,
}
static int bootm_appendroot;
+static int bootm_verbosity;
void bootm_data_init_defaults(struct bootm_data *data)
{
@@ -62,6 +63,7 @@ void bootm_data_init_defaults(struct bootm_data *data)
data->initrd_file = getenv_nonempty("global.bootm.initrd");
data->verify = bootm_get_verify_mode();
data->appendroot = bootm_appendroot;
+ data->verbose = bootm_verbosity;
}
static enum bootm_verify bootm_verify_mode = BOOTM_VERIFY_HASH;
@@ -661,6 +663,8 @@ static int bootm_init(void)
if (IS_ENABLED(CONFIG_BOOTM_FORCE_SIGNED_IMAGES))
bootm_verify_mode = BOOTM_VERIFY_SIGNATURE;
+ globalvar_add_simple_int("bootm.verbose", &bootm_verbosity, "%u");
+
globalvar_add_simple_enum("bootm.verify", (unsigned int *)&bootm_verify_mode,
bootm_verify_names, ARRAY_SIZE(bootm_verify_names));
@@ -675,4 +679,5 @@ BAREBOX_MAGICVAR_NAMED(global_bootm_initrd, global.bootm.initrd, "bootm default
BAREBOX_MAGICVAR_NAMED(global_bootm_initrd_loadaddr, global.bootm.initrd.loadaddr, "bootm default initrd loadaddr");
BAREBOX_MAGICVAR_NAMED(global_bootm_oftree, global.bootm.oftree, "bootm default oftree");
BAREBOX_MAGICVAR_NAMED(global_bootm_verify, global.bootm.verify, "bootm default verify level");
+BAREBOX_MAGICVAR_NAMED(global_bootm_verbose, global.bootm.verify, "bootm default verbosity level (0=quiet)");
BAREBOX_MAGICVAR_NAMED(global_bootm_appendroot, global.bootm.appendroot, "Add root= option to Kernel to mount rootfs from the device the Kernel comes from");