mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
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: Peter Tyser <ptyser@xes-inc.com>
This commit is contained in:
parent
4e1ca93b6b
commit
396fd17338
1 changed files with 22 additions and 0 deletions
|
@ -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
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue