[U-Boot] [PATCH v4 4/9] sandbox: Renamed sb command to host
Sjoerd Simons
sjoerd.simons at collabora.co.uk
Mon Apr 13 22:54:22 CEST 2015
As suggested by Simon Glass, rename the sb command to host but keep the
old sb command as an alias
Signed-off-by: Sjoerd Simons <sjoerd.simons at collabora.co.uk>
Acked-by: Simon Glass <sjg at chromium.org>
---
Changes in v4: None
Changes in v3:
- Improve deprecated sb command short line
- Don't document subcommands for sb anymore
Changes in v2: None
common/Makefile | 2 +-
common/{cmd_sandbox.c => cmd_host.c} | 50 ++++++++++++++++++++----------------
2 files changed, 29 insertions(+), 23 deletions(-)
rename common/{cmd_sandbox.c => cmd_host.c} (62%)
diff --git a/common/Makefile b/common/Makefile
index 252fbf1..978c33b 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -152,7 +152,7 @@ obj-$(CONFIG_CMD_PXE) += cmd_pxe.o
obj-$(CONFIG_CMD_READ) += cmd_read.o
obj-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
obj-$(CONFIG_CMD_REISER) += cmd_reiser.o
-obj-$(CONFIG_SANDBOX) += cmd_sandbox.o
+obj-$(CONFIG_SANDBOX) += cmd_host.o
obj-$(CONFIG_CMD_SATA) += cmd_sata.o
obj-$(CONFIG_CMD_SF) += cmd_sf.o
obj-$(CONFIG_CMD_SCSI) += cmd_scsi.o
diff --git a/common/cmd_sandbox.c b/common/cmd_host.c
similarity index 62%
rename from common/cmd_sandbox.c
rename to common/cmd_host.c
index 4286969..323a795 100644
--- a/common/cmd_sandbox.c
+++ b/common/cmd_host.c
@@ -10,25 +10,25 @@
#include <sandboxblockdev.h>
#include <asm/errno.h>
-static int do_sandbox_load(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_host_load(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
return do_load(cmdtp, flag, argc, argv, FS_TYPE_SANDBOX);
}
-static int do_sandbox_ls(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_host_ls(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
return do_ls(cmdtp, flag, argc, argv, FS_TYPE_SANDBOX);
}
-static int do_sandbox_save(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_host_save(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
return do_save(cmdtp, flag, argc, argv, FS_TYPE_SANDBOX);
}
-static int do_sandbox_bind(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_host_bind(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
if (argc < 2 || argc > 3)
@@ -44,7 +44,7 @@ static int do_sandbox_bind(cmd_tbl_t *cmdtp, int flag, int argc,
return host_dev_bind(dev, file);
}
-static int do_sandbox_info(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_host_info(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
if (argc < 1 || argc > 2)
@@ -85,25 +85,25 @@ static int do_sandbox_info(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
-static cmd_tbl_t cmd_sandbox_sub[] = {
- U_BOOT_CMD_MKENT(load, 7, 0, do_sandbox_load, "", ""),
- U_BOOT_CMD_MKENT(ls, 3, 0, do_sandbox_ls, "", ""),
- U_BOOT_CMD_MKENT(save, 6, 0, do_sandbox_save, "", ""),
- U_BOOT_CMD_MKENT(bind, 3, 0, do_sandbox_bind, "", ""),
- U_BOOT_CMD_MKENT(info, 3, 0, do_sandbox_info, "", ""),
+static cmd_tbl_t cmd_host_sub[] = {
+ U_BOOT_CMD_MKENT(load, 7, 0, do_host_load, "", ""),
+ U_BOOT_CMD_MKENT(ls, 3, 0, do_host_ls, "", ""),
+ U_BOOT_CMD_MKENT(save, 6, 0, do_host_save, "", ""),
+ U_BOOT_CMD_MKENT(bind, 3, 0, do_host_bind, "", ""),
+ U_BOOT_CMD_MKENT(info, 3, 0, do_host_info, "", ""),
};
-static int do_sandbox(cmd_tbl_t *cmdtp, int flag, int argc,
+static int do_host(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
cmd_tbl_t *c;
- /* Skip past 'sandbox' */
+ /* Skip past 'host' */
argc--;
argv++;
- c = find_cmd_tbl(argv[0], cmd_sandbox_sub,
- ARRAY_SIZE(cmd_sandbox_sub));
+ c = find_cmd_tbl(argv[0], cmd_host_sub,
+ ARRAY_SIZE(cmd_host_sub));
if (c)
return c->cmd(cmdtp, flag, argc, argv);
@@ -112,15 +112,21 @@ static int do_sandbox(cmd_tbl_t *cmdtp, int flag, int argc,
}
U_BOOT_CMD(
- sb, 8, 1, do_sandbox,
- "Miscellaneous sandbox commands",
+ sb, 8, 1, do_host,
+ "Deprecated: use 'host' command instead.", ""
+);
+
+U_BOOT_CMD(
+ host, 8, 1, do_host,
+ "Miscellaneous host commands",
"load hostfs - <addr> <filename> [<bytes> <offset>] - "
"load a file from host\n"
- "sb ls hostfs - <filename> - list files on host\n"
- "sb save hostfs - <addr> <filename> <bytes> [<offset>] - "
+ "host ls hostfs - <filename> - list files on host\n"
+ "host save hostfs - <addr> <filename> <bytes> [<offset>] - "
"save a file to host\n"
- "sb bind <dev> [<filename>] - bind \"host\" device to file\n"
- "sb info [<dev>] - show device binding & info\n"
- "sb commands use the \"hostfs\" device. The \"host\" device is used\n"
+ "host bind <dev> [<filename>] - bind \"host\" device to file\n"
+ "host info [<dev>] - show device binding & info\n"
+ "host commands use the \"hostfs\" device. The \"host\" device is used\n"
"with standard IO commands such as fatls or ext2load"
);
+
--
2.1.4
More information about the U-Boot
mailing list