mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-28 18:11:33 +00:00
sandbox: Don't try distro_bootcmd by default
For the distro_bootcmds to succeed on the sandbox a bit of setup is required (e.g. network configured or host image bound), so running them by default isn't that useful. Add a -b/--boot command to the sandbox binary, which triggers the distro_bootcmds to run after the other command-line commands. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
fa5b9baa0c
commit
ebaa832e99
3 changed files with 20 additions and 3 deletions
|
@ -77,12 +77,18 @@ int sandbox_main_loop_init(void)
|
||||||
struct sandbox_state *state = state_get_current();
|
struct sandbox_state *state = state_get_current();
|
||||||
|
|
||||||
/* Execute command if required */
|
/* Execute command if required */
|
||||||
if (state->cmd) {
|
if (state->cmd || state->run_distro_boot) {
|
||||||
int retval;
|
int retval = 0;
|
||||||
|
|
||||||
cli_init();
|
cli_init();
|
||||||
|
|
||||||
retval = run_command_list(state->cmd, -1, 0);
|
if (state->cmd)
|
||||||
|
retval = run_command_list(state->cmd, -1, 0);
|
||||||
|
|
||||||
|
if (state->run_distro_boot)
|
||||||
|
retval = cli_simple_run_command("run distro_bootcmd",
|
||||||
|
0);
|
||||||
|
|
||||||
if (!state->interactive)
|
if (!state->interactive)
|
||||||
os_exit(retval);
|
os_exit(retval);
|
||||||
}
|
}
|
||||||
|
@ -90,6 +96,14 @@ int sandbox_main_loop_init(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int sandbox_cmdline_cb_boot(struct sandbox_state *state,
|
||||||
|
const char *arg)
|
||||||
|
{
|
||||||
|
state->run_distro_boot = true;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
SANDBOX_CMDLINE_OPT_SHORT(boot, 'b', 0, "Run distro boot commands");
|
||||||
|
|
||||||
static int sandbox_cmdline_cb_command(struct sandbox_state *state,
|
static int sandbox_cmdline_cb_command(struct sandbox_state *state,
|
||||||
const char *arg)
|
const char *arg)
|
||||||
{
|
{
|
||||||
|
|
|
@ -42,6 +42,7 @@ struct sandbox_spi_info {
|
||||||
struct sandbox_state {
|
struct sandbox_state {
|
||||||
const char *cmd; /* Command to execute */
|
const char *cmd; /* Command to execute */
|
||||||
bool interactive; /* Enable cmdline after execute */
|
bool interactive; /* Enable cmdline after execute */
|
||||||
|
bool run_distro_boot; /* Automatically run distro bootcommands */
|
||||||
const char *fdt_fname; /* Filename of FDT binary */
|
const char *fdt_fname; /* Filename of FDT binary */
|
||||||
const char *parse_err; /* Error to report from parsing */
|
const char *parse_err; /* Error to report from parsing */
|
||||||
int argc; /* Program arguments */
|
int argc; /* Program arguments */
|
||||||
|
|
|
@ -125,6 +125,8 @@
|
||||||
func(HOST, host, 1) \
|
func(HOST, host, 1) \
|
||||||
func(HOST, host, 0)
|
func(HOST, host, 0)
|
||||||
|
|
||||||
|
#define CONFIG_BOOTCOMMAND ""
|
||||||
|
|
||||||
#include <config_distro_bootcmd.h>
|
#include <config_distro_bootcmd.h>
|
||||||
|
|
||||||
#define CONFIG_KEEP_SERVERADDR
|
#define CONFIG_KEEP_SERVERADDR
|
||||||
|
|
Loading…
Add table
Reference in a new issue