summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorPeter Tyser <ptyser@xes-inc.com>2009-10-16 17:36:27 -0500
committerWolfgang Denk <wd@denx.de>2009-11-23 00:06:13 +0100
commit396fd17338b9bf1f84f494ec1860427e18868ede (patch)
treef57d8bfd1b7b56a1cd2de8c33eed0df2bbaee5bb /common
parent4e1ca93b6bae34b68be9280b43bf0289d994656c (diff)
downloadu-boot-imx-396fd17338b9bf1f84f494ec1860427e18868ede.zip
u-boot-imx-396fd17338b9bf1f84f494ec1860427e18868ede.tar.gz
u-boot-imx-396fd17338b9bf1f84f494ec1860427e18868ede.tar.bz2
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>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_test.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/common/cmd_test.c b/common/cmd_test.c
index 3cdd07b..d886f89 100644
--- a/common/cmd_test.c
+++ b/common/cmd_test.c
@@ -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
+);