summaryrefslogtreecommitdiff
path: root/arch/sandbox
diff options
context:
space:
mode:
authorRabin Vincent <rabin@rab.in>2014-10-29 23:21:38 +0100
committerTom Rini <trini@ti.com>2014-11-07 16:27:05 -0500
commit7dbcb76e77361970f7223c1bca4fdc9bb0436a08 (patch)
treecb7ef79e3e9121c8cf5efea3c1a330647d78eb0a /arch/sandbox
parent854d2b9753e464b7c1add062702565ebdb464119 (diff)
downloadu-boot-imx-7dbcb76e77361970f7223c1bca4fdc9bb0436a08.zip
u-boot-imx-7dbcb76e77361970f7223c1bca4fdc9bb0436a08.tar.gz
u-boot-imx-7dbcb76e77361970f7223c1bca4fdc9bb0436a08.tar.bz2
sandbox: init cli for -c
sandbox crashes if a variable is set in the -c command, because hush's top_vars is not allocated. Call cli_init() from sandbox to ensure this is done before we execute the -c command. $ ./u-boot -c 'a=1' ... Segmentation fault (core dumped) Signed-off-by: Rabin Vincent <rabin@rab.in> Acked-by: Simon Glass <sjg@chromium.org) Tested-by: Simon Glass <sjg@chromium.org)
Diffstat (limited to 'arch/sandbox')
-rw-r--r--arch/sandbox/cpu/start.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index b3d7051..53a99ae 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <os.h>
+#include <cli.h>
#include <asm/getopt.h>
#include <asm/io.h>
#include <asm/sections.h>
@@ -76,6 +77,8 @@ int sandbox_main_loop_init(void)
/* Execute command if required */
if (state->cmd) {
+ cli_init();
+
run_command_list(state->cmd, -1, 0);
if (!state->interactive)
os_exit(state->exit_type);