Skip to content
Snippets Groups Projects
Commit 396fd173 authored by Peter Tyser's avatar Peter Tyser Committed by Wolfgang Denk
Browse files

Add 'true' and 'false' commands


These commands are only enabled when the hush shell is enabled and can
be useful in scripts such as:

while true do
    echo "Booting OS...";
    run $bootcmd;
    echo "Booting OS failed";
    sleep 10;
done

Signed-off-by: default avatarPeter Tyser <ptyser@xes-inc.com>
parent 4e1ca93b
No related branches found
No related tags found
No related merge requests found
......@@ -149,3 +149,25 @@ U_BOOT_CMD(
"minimal test like /bin/sh",
"[args..]"
);
int do_false(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
return 1;
}
U_BOOT_CMD(
false, CONFIG_SYS_MAXARGS, 1, do_false,
"do nothing, unsuccessfully",
NULL
);
int do_true(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
return 0;
}
U_BOOT_CMD(
true, CONFIG_SYS_MAXARGS, 1, do_true,
"do nothing, successfully",
NULL
);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment