projects
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4e1ca93
)
Add 'true' and 'false' commands
author
Peter Tyser
<ptyser@xes-inc.com>
Fri, 16 Oct 2009 22:36:27 +0000
(17:36 -0500)
committer
Wolfgang Denk
<wd@denx.de>
Sun, 22 Nov 2009 23:06:13 +0000
(
00:06
+0100)
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>
common/cmd_test.c
patch
|
blob
|
history
diff --git
a/common/cmd_test.c
b/common/cmd_test.c
index
3cdd07b
..
d886f89
100644
(file)
--- a/
common/cmd_test.c
+++ b/
common/cmd_test.c
@@
-149,3
+149,25
@@
U_BOOT_CMD(
"minimal test like /bin/sh",
"[args..]"
);
"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
+);