* [PATCH 1/2] bootm: Move magicvar descriptions to common/bootm.c
@ 2016-05-11 6:16 Sascha Hauer
2016-05-11 6:17 ` [PATCH 2/2] bootm: make verbosity controllable via global variable Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2016-05-11 6:16 UTC (permalink / raw)
To: Barebox List
Now that the bootm code can be used without the command, we have to
move the magicvar descriptions from the command code to the common
bootm code aswell.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
commands/bootm.c | 10 ----------
common/bootm.c | 10 ++++++++++
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/commands/bootm.c b/commands/bootm.c
index a46faae..6bedb00 100644
--- a/commands/bootm.c
+++ b/commands/bootm.c
@@ -37,7 +37,6 @@
#include <rtc.h>
#include <init.h>
#include <of.h>
-#include <magicvar.h>
#include <uncompress.h>
#include <memory.h>
#include <filetype.h>
@@ -159,15 +158,6 @@ BAREBOX_CMD_START(bootm)
BAREBOX_CMD_HELP(cmd_bootm_help)
BAREBOX_CMD_END
-BAREBOX_MAGICVAR(bootargs, "Linux kernel parameters");
-BAREBOX_MAGICVAR_NAMED(global_bootm_image, global.bootm.image, "bootm default boot image");
-BAREBOX_MAGICVAR_NAMED(global_bootm_image_loadaddr, global.bootm.image.loadaddr, "bootm default boot image loadaddr");
-BAREBOX_MAGICVAR_NAMED(global_bootm_initrd, global.bootm.initrd, "bootm default initrd");
-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_appendroot, global.bootm.appendroot, "Add root= option to Kernel to mount rootfs from the device the Kernel comes from");
-
static struct binfmt_hook binfmt_uimage_hook = {
.type = filetype_uimage,
.exec = "bootm",
diff --git a/common/bootm.c b/common/bootm.c
index bf1b344..66a5bf3 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -21,6 +21,7 @@
#include <globalvar.h>
#include <init.h>
#include <linux/stat.h>
+#include <magicvar.h>
static LIST_HEAD(handler_list);
@@ -666,3 +667,12 @@ static int bootm_init(void)
return 0;
}
late_initcall(bootm_init);
+
+BAREBOX_MAGICVAR(bootargs, "Linux kernel parameters");
+BAREBOX_MAGICVAR_NAMED(global_bootm_image, global.bootm.image, "bootm default boot image");
+BAREBOX_MAGICVAR_NAMED(global_bootm_image_loadaddr, global.bootm.image.loadaddr, "bootm default boot image loadaddr");
+BAREBOX_MAGICVAR_NAMED(global_bootm_initrd, global.bootm.initrd, "bootm default initrd");
+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_appendroot, global.bootm.appendroot, "Add root= option to Kernel to mount rootfs from the device the Kernel comes from");
--
2.8.0.rc3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 2/2] bootm: make verbosity controllable via global variable
2016-05-11 6:16 [PATCH 1/2] bootm: Move magicvar descriptions to common/bootm.c Sascha Hauer
@ 2016-05-11 6:17 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2016-05-11 6:17 UTC (permalink / raw)
To: Barebox List
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>
---
common/bootm.c | 5 +++++
1 file changed, 5 insertions(+)
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");
--
2.8.0.rc3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-11 6:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-11 6:16 [PATCH 1/2] bootm: Move magicvar descriptions to common/bootm.c Sascha Hauer
2016-05-11 6:17 ` [PATCH 2/2] bootm: make verbosity controllable via global variable Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox