summaryrefslogtreecommitdiff
path: root/doc/usage
diff options
context:
space:
mode:
authorRoger Knecht <rknecht@pm.me>2022-09-03 16:15:04 +0300
committerTom Rini <trini@konsulko.com>2022-10-11 22:40:48 +0300
commit23c0df6e7cd3f220a81151b662f0280bba0054b9 (patch)
tree15bac492af33d58a7b244c914cd1714a7ffc3964 /doc/usage
parent690a1d694899c55c7cc6a168c54984f765ff761e (diff)
downloadu-boot-23c0df6e7cd3f220a81151b662f0280bba0054b9.tar.xz
cmd: xxd: add new command
Add xxd command to print file content as hexdump to standard out Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Roger Knecht <rknecht@pm.me>
Diffstat (limited to 'doc/usage')
-rw-r--r--doc/usage/cmd/xxd.rst50
-rw-r--r--doc/usage/index.rst1
2 files changed, 51 insertions, 0 deletions
diff --git a/doc/usage/cmd/xxd.rst b/doc/usage/cmd/xxd.rst
new file mode 100644
index 0000000000..0de1223dce
--- /dev/null
+++ b/doc/usage/cmd/xxd.rst
@@ -0,0 +1,50 @@
+.. SPDX-License-Identifier: GPL-2.0+:
+
+xxd command
+===============
+
+Synopsis
+--------
+
+::
+
+ xxd <interface> <dev[:part]> <file>
+
+Description
+-----------
+
+The xxd command prints the file content as hexdump to standard out.
+
+interface
+ interface for accessing the block device (mmc, sata, scsi, usb, ....)
+
+dev
+ device number
+
+part
+ partition number, defaults to 1
+
+file
+ path to file
+
+Example
+-------
+
+Here is the output for a example text file:
+
+::
+
+ => xxd mmc 0:1 hello
+ 00000000: 68 65 6c 6c 6f 20 77 6f 72 6c 64 0a 00 01 02 03 hello world.....
+ 00000010: 04 05 ..
+ =>
+
+Configuration
+-------------
+
+The xxd command is only available if CONFIG_CMD_XXD=y.
+
+Return value
+------------
+
+The return value $? is set to 0 (true) if the file is readable, otherwise it returns a non-zero error code.
diff --git a/doc/usage/index.rst b/doc/usage/index.rst
index a05aa42485..64a265879d 100644
--- a/doc/usage/index.rst
+++ b/doc/usage/index.rst
@@ -72,6 +72,7 @@ Shell commands
cmd/true
cmd/ums
cmd/wdt
+ cmd/xxd
Booting OS
----------