diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-11-29 20:52:03 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-11-29 20:52:03 +0100 |
commit | 7631e76c0b472e95c908866d26883b019657636d (patch) | |
tree | c177100f2ed9f13ca33ec159bbf69b6114d0c23b /commands | |
parent | e0f4fb2c982d66210dfd5ffaf92912bf1c6c6586 (diff) | |
parent | 7766c288ff6e6defd7565af73a3407c3c414eb94 (diff) | |
download | barebox-7631e76c0b472e95c908866d26883b019657636d.tar.gz barebox-7631e76c0b472e95c908866d26883b019657636d.tar.xz |
Merge branch 'work/magicvars' into next
Diffstat (limited to 'commands')
-rw-r--r-- | commands/Kconfig | 14 | ||||
-rw-r--r-- | commands/Makefile | 1 | ||||
-rw-r--r-- | commands/bootm.c | 3 | ||||
-rw-r--r-- | commands/magicvar.c | 20 |
4 files changed, 38 insertions, 0 deletions
diff --git a/commands/Kconfig b/commands/Kconfig index 18ab840916..78b9d2a0e6 100644 --- a/commands/Kconfig +++ b/commands/Kconfig @@ -383,6 +383,20 @@ config CMD_HELP default y prompt "help" +config CMD_MAGICVAR + tristate + prompt "magicvar" + help + barebox has some shell variables with special meanings. This + command shows the available magic variables. + +config CMD_MAGICVAR_HELP + bool + prompt "display description" + depends on CMD_MAGICVAR + help + Also display a description to the magic variables + config CMD_DEVINFO tristate default y diff --git a/commands/Makefile b/commands/Makefile index 5c519169c3..9b3a349bd2 100644 --- a/commands/Makefile +++ b/commands/Makefile @@ -58,3 +58,4 @@ obj-$(CONFIG_CMD_LED_TRIGGER) += trigger.o obj-$(CONFIG_CMD_USB) += usb.o obj-$(CONFIG_CMD_TIME) += time.o obj-$(CONFIG_CMD_OFTREE) += oftree.o +obj-$(CONFIG_CMD_MAGICVAR) += magicvar.o diff --git a/commands/bootm.c b/commands/bootm.c index 731b74dcee..a4d1c367f0 100644 --- a/commands/bootm.c +++ b/commands/bootm.c @@ -42,6 +42,7 @@ #include <boot.h> #include <rtc.h> #include <init.h> +#include <magicvar.h> #include <asm-generic/memory_layout.h> /* @@ -365,6 +366,8 @@ BAREBOX_CMD_START(bootm) BAREBOX_CMD_HELP(cmd_bootm_help) BAREBOX_CMD_END +BAREBOX_MAGICVAR(bootargs, "Linux Kernel parameters"); + /** * @page bootm_command diff --git a/commands/magicvar.c b/commands/magicvar.c new file mode 100644 index 0000000000..31606d2afa --- /dev/null +++ b/commands/magicvar.c @@ -0,0 +1,20 @@ +#include <common.h> +#include <command.h> +#include <magicvar.h> + +static int do_magicvar(struct command *cmdtp, int argc, char *argv[]) +{ + struct magicvar *m; + + for (m = &__barebox_magicvar_start; + m != &__barebox_magicvar_end; + m++) + printf("%-32s %s\n", m->name, m->description); + + return 0; +} + +BAREBOX_CMD_START(magicvar) + .cmd = do_magicvar, + .usage = "List information about magic variables", +BAREBOX_CMD_END |