aboutsummaryrefslogtreecommitdiff
path: root/doc/usage/cmd
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-03-21 08:35:23 -0400
committerTom Rini <trini@konsulko.com>2024-03-21 08:35:23 -0400
commit5397daaed8994000f2b3480896df9c163dea4375 (patch)
tree21671fe2a0f3ff4fbeda01be16060406004d93d5 /doc/usage/cmd
parent6ec096a7116a5f1f7dfac5f69ef192429331905c (diff)
parentfcd0c8b8474f7db0b94608424715a73fbeba92dc (diff)
Merge tag 'efi-2024-04-rc5-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2024-04-rc5-2 Documentation: * patman: Properly document the patchwork_url setting * doc: man-page for if * colibri-imx8x, apalis-imx8: update board documentation UEFI: * correct handling of EFI binary return code * don't show usage help if EFI binary fails. * correct error handling for bootefi selftest command
Diffstat (limited to 'doc/usage/cmd')
-rw-r--r--doc/usage/cmd/acpi.rst4
-rw-r--r--doc/usage/cmd/bootdev.rst4
-rw-r--r--doc/usage/cmd/bootflow.rst4
-rw-r--r--doc/usage/cmd/bootmeth.rst4
-rw-r--r--doc/usage/cmd/cbsysinfo.rst4
-rw-r--r--doc/usage/cmd/cedit.rst4
-rw-r--r--doc/usage/cmd/cli.rst4
-rw-r--r--doc/usage/cmd/dm.rst4
-rw-r--r--doc/usage/cmd/fdt.rst4
-rw-r--r--doc/usage/cmd/font.rst4
-rw-r--r--doc/usage/cmd/for.rst4
-rw-r--r--doc/usage/cmd/history.rst4
-rw-r--r--doc/usage/cmd/host.rst4
-rw-r--r--doc/usage/cmd/if.rst72
-rw-r--r--doc/usage/cmd/md.rst4
-rw-r--r--doc/usage/cmd/mtrr.rst4
-rw-r--r--doc/usage/cmd/panic.rst4
-rw-r--r--doc/usage/cmd/part.rst4
-rw-r--r--doc/usage/cmd/sf.rst4
-rw-r--r--doc/usage/cmd/sm.rst4
-rw-r--r--doc/usage/cmd/trace.rst4
-rw-r--r--doc/usage/cmd/ut.rst4
22 files changed, 114 insertions, 42 deletions
diff --git a/doc/usage/cmd/acpi.rst b/doc/usage/cmd/acpi.rst
index a630f1ec5e..9f30972fe5 100644
--- a/doc/usage/cmd/acpi.rst
+++ b/doc/usage/cmd/acpi.rst
@@ -6,8 +6,8 @@
acpi command
============
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/bootdev.rst b/doc/usage/cmd/bootdev.rst
index 658020e7c7..f759abab35 100644
--- a/doc/usage/cmd/bootdev.rst
+++ b/doc/usage/cmd/bootdev.rst
@@ -6,8 +6,8 @@
bootdev command
===============
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/bootflow.rst b/doc/usage/cmd/bootflow.rst
index 16ba986dc8..6519e4880a 100644
--- a/doc/usage/cmd/bootflow.rst
+++ b/doc/usage/cmd/bootflow.rst
@@ -6,8 +6,8 @@
bootflow command
================
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/bootmeth.rst b/doc/usage/cmd/bootmeth.rst
index 95651fdc7c..2903977ee5 100644
--- a/doc/usage/cmd/bootmeth.rst
+++ b/doc/usage/cmd/bootmeth.rst
@@ -6,8 +6,8 @@
bootmeth command
================
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/cbsysinfo.rst b/doc/usage/cmd/cbsysinfo.rst
index 8c03a85169..80d8ba1b66 100644
--- a/doc/usage/cmd/cbsysinfo.rst
+++ b/doc/usage/cmd/cbsysinfo.rst
@@ -3,8 +3,8 @@
cbsysinfo
=========
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/cedit.rst b/doc/usage/cmd/cedit.rst
index b39d708281..5670805a00 100644
--- a/doc/usage/cmd/cedit.rst
+++ b/doc/usage/cmd/cedit.rst
@@ -6,8 +6,8 @@
cedit command
=============
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/cli.rst b/doc/usage/cmd/cli.rst
index 81487722f6..23e5ee7a90 100644
--- a/doc/usage/cmd/cli.rst
+++ b/doc/usage/cmd/cli.rst
@@ -6,8 +6,8 @@
cli command
===========
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/dm.rst b/doc/usage/cmd/dm.rst
index 9bef2eeaed..7651507937 100644
--- a/doc/usage/cmd/dm.rst
+++ b/doc/usage/cmd/dm.rst
@@ -6,8 +6,8 @@
dm command
==========
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/fdt.rst b/doc/usage/cmd/fdt.rst
index 3e8c32cdea..71a9fc627e 100644
--- a/doc/usage/cmd/fdt.rst
+++ b/doc/usage/cmd/fdt.rst
@@ -6,8 +6,8 @@
fdt command
===========
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/font.rst b/doc/usage/cmd/font.rst
index adcd5126d0..a878254633 100644
--- a/doc/usage/cmd/font.rst
+++ b/doc/usage/cmd/font.rst
@@ -6,8 +6,8 @@
font command
============
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/for.rst b/doc/usage/cmd/for.rst
index 4c98419b28..729bd4db43 100644
--- a/doc/usage/cmd/for.rst
+++ b/doc/usage/cmd/for.rst
@@ -4,8 +4,8 @@
for command
===========
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/history.rst b/doc/usage/cmd/history.rst
index 564a159665..b52b5b220a 100644
--- a/doc/usage/cmd/history.rst
+++ b/doc/usage/cmd/history.rst
@@ -6,8 +6,8 @@
history command
===============
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/host.rst b/doc/usage/cmd/host.rst
index 072497db90..a70a432b6f 100644
--- a/doc/usage/cmd/host.rst
+++ b/doc/usage/cmd/host.rst
@@ -6,8 +6,8 @@
host command
============
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/if.rst b/doc/usage/cmd/if.rst
new file mode 100644
index 0000000000..6b3dbe7b0a
--- /dev/null
+++ b/doc/usage/cmd/if.rst
@@ -0,0 +1,72 @@
+.. SPDX-License-Identifier: GPL-2.0-or-later
+
+.. index::
+ single: if (command)
+
+if command
+==========
+
+Synopsis
+--------
+
+::
+
+ if <test statement>
+ then
+ <statements>
+ fi
+
+ if <test statement>
+ then
+ <statements>
+ else
+ <statements>
+ fi
+
+Description
+-----------
+
+The if command is used to conditionally execute statements.
+
+test statement
+ Any command. The test statement set the $? variable. If the value of
+ $? becomes 0 (true) the statements after the **then** statement will
+ be executed. Otherwise the statements after the **else** statement.
+
+Example
+-------
+
+The examples shows how the value of a numeric variable can be tested with
+**itest**.
+
+::
+
+ => a=1; if itest $a == 0; then echo true; else echo false; fi
+ false
+ => a=0; if itest $a == 0; then echo true; else echo false; fi
+ true
+
+In the following example we try to load an EFI binary via TFTP. If loading
+succeeds, the binary is executed.
+
+::
+
+ if tftp $kernel_addr_r shellriscv64.efi; then bootefi $kernel_addr_r; fi
+
+Return value
+------------
+
+The value of $? is the return value of the last executed statement.
+
+::
+
+ => if true; then true; else true; fi; echo $?
+ 0
+ => if false; then true; else true; fi; echo $?
+ 0
+ => if false; then false; else false; fi; echo $?
+ 1
+ => if true; then false; else false; fi; echo $?
+ 1
+ => if false; then true; fi; echo $?
+ 1
diff --git a/doc/usage/cmd/md.rst b/doc/usage/cmd/md.rst
index 9ea148a8dc..9a9919f9ad 100644
--- a/doc/usage/cmd/md.rst
+++ b/doc/usage/cmd/md.rst
@@ -6,8 +6,8 @@
md command
==========
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/mtrr.rst b/doc/usage/cmd/mtrr.rst
index c65618950b..3c5c3ba3d4 100644
--- a/doc/usage/cmd/mtrr.rst
+++ b/doc/usage/cmd/mtrr.rst
@@ -6,8 +6,8 @@
mtrr command
============
-Synopis
--------
+Synopsis
+--------
mtrr [list]
mtrr set <reg> <type> <start> <size>
diff --git a/doc/usage/cmd/panic.rst b/doc/usage/cmd/panic.rst
index ba5ea62610..39d32adbc9 100644
--- a/doc/usage/cmd/panic.rst
+++ b/doc/usage/cmd/panic.rst
@@ -6,8 +6,8 @@
panic command
=============
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/part.rst b/doc/usage/cmd/part.rst
index 58be38781e..e7faeccbb0 100644
--- a/doc/usage/cmd/part.rst
+++ b/doc/usage/cmd/part.rst
@@ -6,8 +6,8 @@
part command
============
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/sf.rst b/doc/usage/cmd/sf.rst
index 24d5dc692d..dfdca46e66 100644
--- a/doc/usage/cmd/sf.rst
+++ b/doc/usage/cmd/sf.rst
@@ -6,8 +6,8 @@
sf command
==========
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/sm.rst b/doc/usage/cmd/sm.rst
index b767647d77..e828fddc51 100644
--- a/doc/usage/cmd/sm.rst
+++ b/doc/usage/cmd/sm.rst
@@ -6,8 +6,8 @@
sm command
==========
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/trace.rst b/doc/usage/cmd/trace.rst
index ad6db12394..e798b2bbc6 100644
--- a/doc/usage/cmd/trace.rst
+++ b/doc/usage/cmd/trace.rst
@@ -6,8 +6,8 @@
trace command
=============
-Synopis
--------
+Synopsis
+--------
::
diff --git a/doc/usage/cmd/ut.rst b/doc/usage/cmd/ut.rst
index ddc48ec42d..45bc9ffbdc 100644
--- a/doc/usage/cmd/ut.rst
+++ b/doc/usage/cmd/ut.rst
@@ -6,8 +6,8 @@
ut command
==========
-Synopis
--------
+Synopsis
+--------
::