summaryrefslogtreecommitdiffstats
path: root/Documentation/user
diff options
context:
space:
mode:
authorRoland Hieber <r.hieber@pengutronix.de>2018-08-10 00:22:59 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-08-10 08:41:09 +0200
commit68de5efb38fd2f38fa3f59c26fd07fa3b1180186 (patch)
treef56b1edb85b159f785c35c06ad113d2dacb29d56 /Documentation/user
parentc3b5e27c5d1f1049b400339b721eff20e0e1243a (diff)
downloadbarebox-68de5efb38fd2f38fa3f59c26fd07fa3b1180186.tar.gz
barebox-68de5efb38fd2f38fa3f59c26fd07fa3b1180186.tar.xz
Documentation: fix code block and literal block highlighting
Use shell script highlighting where it is resonable, use console highlighting for transcripts, and fix some of the few cases where the syntax was broken, resulting in text not being rendered at all. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'Documentation/user')
-rw-r--r--Documentation/user/automount.rst12
-rw-r--r--Documentation/user/barebox.rst4
-rw-r--r--Documentation/user/defaultenv-2.rst4
-rw-r--r--Documentation/user/driver-model.rst20
-rw-r--r--Documentation/user/hush.rst24
-rw-r--r--Documentation/user/memory-areas.rst8
-rw-r--r--Documentation/user/system-setup.rst12
-rw-r--r--Documentation/user/updating.rst8
-rw-r--r--Documentation/user/variables.rst14
9 files changed, 77 insertions, 29 deletions
diff --git a/Documentation/user/automount.rst b/Documentation/user/automount.rst
index 7de8261354..1fdeffc663 100644
--- a/Documentation/user/automount.rst
+++ b/Documentation/user/automount.rst
@@ -10,7 +10,9 @@ filesystems. The filesystems (and the devices they are on) are only probed
when necessary, so barebox does not lose time probing unused devices.
Typical usage is for accessing the TFTP server. To set up an automount for a
-TFTP server, the following is required::
+TFTP server, the following is required:
+
+.. code-block:: sh
mkdir -p /mnt/tftp
automount /mnt/tftp 'ifup -a && mount -t tftp $global.net.server /mnt/tftp'
@@ -21,12 +23,16 @@ It will bring up the network device using :ref:`command_ifup` and mount a TFTP f
using :ref:`command_mount`.
Usually the above automount command is executed from an init script in ``/env/init/automount``.
-With the above, files on the TFTP server can be accessed without configuration::
+With the above, files on the TFTP server can be accessed without configuration:
+
+.. code-block:: sh
cp /mnt/tftp/linuximage /image
This automatically detects a USB mass storage device and mounts the first
-partition to ``/mnt/fat``::
+partition to ``/mnt/fat``:
+
+.. code-block:: sh
mkdir -p /mnt/fat
automount -d /mnt/fat 'usb && [ -e /dev/disk0.0 ] && mount /dev/disk0.0 /mnt/fat'
diff --git a/Documentation/user/barebox.rst b/Documentation/user/barebox.rst
index 82a33a3219..026ed1b9c0 100644
--- a/Documentation/user/barebox.rst
+++ b/Documentation/user/barebox.rst
@@ -181,9 +181,7 @@ simply with:
The resulting binary varies depending on the board barebox is compiled for.
Without :ref:`multi_image` support the ``barebox-flash-image`` link will point
to the binary for flashing/uploading to the board. With :ref:`multi_image` support
-the compilation process will finish with a list of images built under ``images/``:
-
-.. code-block:: sh
+the compilation process will finish with a list of images built under ``images/``::
images built:
barebox-freescale-imx51-babbage.img
diff --git a/Documentation/user/defaultenv-2.rst b/Documentation/user/defaultenv-2.rst
index 7502d3de10..a79ae83d56 100644
--- a/Documentation/user/defaultenv-2.rst
+++ b/Documentation/user/defaultenv-2.rst
@@ -44,7 +44,9 @@ and their respective included directories in ``defaultenv/Makefile``:
This script is executed by the barebox startup code after initialization.
In defaultenv-2, this script will define and set a number of global
-variables, followed by sourcing all of the scripts in ``/env/init/`` with::
+variables, followed by sourcing all of the scripts in ``/env/init/`` with:
+
+.. code-block:: sh
for i in /env/init/*; do
. $i
diff --git a/Documentation/user/driver-model.rst b/Documentation/user/driver-model.rst
index ce7083589c..a0fd3e99b5 100644
--- a/Documentation/user/driver-model.rst
+++ b/Documentation/user/driver-model.rst
@@ -32,7 +32,9 @@ Some devices like USB or MMC may take a longer time to probe. Probing USB
devices should not delay booting when USB may not even be used. This case is
handled with device detection. The user visible interface to device detection
is the :ref:`command_detect` command. ``detect -l`` shows a list of detectable
-devices::
+devices:
+
+.. code-block:: console
barebox:/ detect -l
70004000.esdhc
@@ -46,7 +48,9 @@ devices::
mmc1
miibus0
-A particular device can be detected with ``detect <devname>``::
+A particular device can be detected with ``detect <devname>``:
+
+.. code-block:: console
barebox:/ detect 73f80200.usb
Found SMSC USB331x ULPI transceiver (0x0424:0x0006).
@@ -67,7 +71,9 @@ Device parameters
Devices can have parameters which can be used to configure devices or to provide
additional information for a device. The parameters can be listed with the
:ref:`command_devinfo` command. A ``devinfo <devicename>`` will print the parameters
-of a device::
+of a device:
+
+.. code-block:: console
barebox:/ devinfo eth0
Parameters:
@@ -77,12 +83,16 @@ of a device::
netmask: 255.255.0.0
ethaddr: 00:1c:49:01:03:4b
-The parameters can be used as shell variables::
+The parameters can be used as shell variables:
+
+.. code-block:: sh
eth0.ipaddr=192.168.23.15
echo "my current ip is: $eth0.ipaddr"
-device variables may have a type, so assigning wrong values may fail::
+device variables may have a type, so assigning wrong values may fail:
+
+.. code-block:: console
barebox:/ eth0.ipaddr="This is not an IP"
set parameter: Invalid argument
diff --git a/Documentation/user/hush.rst b/Documentation/user/hush.rst
index 00d4e2983e..a4d8688142 100644
--- a/Documentation/user/hush.rst
+++ b/Documentation/user/hush.rst
@@ -13,13 +13,17 @@ more flexible and also more robust than a complicated shell script.
Hush features
-------------
-variables::
+variables:
+
+.. code-block:: sh
a="Hello user"
echo $a
Hello user
-conditional execution ``if`` / ``elif`` / ``else`` / ``fi``::
+conditional execution ``if`` / ``elif`` / ``else`` / ``fi``:
+
+.. code-block:: sh
if [ ${foo} = ${bar} ]; then
echo "foo equals bar"
@@ -27,19 +31,25 @@ conditional execution ``if`` / ``elif`` / ``else`` / ``fi``::
echo "foo and bar differ"
fi
-``for`` loops::
+``for`` loops:
+
+.. code-block:: sh
for i in a b c; do
echo $i
done
-``while`` loops::
+``while`` loops:
+
+.. code-block:: sh
while true; do
echo "endless loop"
done
-wildcard globbing::
+wildcard globbing:
+
+.. code-block:: sh
ls d*
echo ???
@@ -53,7 +63,9 @@ stored.
**NOTE:** hush feels like a normal Unix shell, but it cannot calculate by
itself, i.e. $(($A/2)) won't work. Calculation can however be done
-with :ref:`command_let`::
+with :ref:`command_let`:
+
+.. code-block:: sh
A=10
let B=$A/2
diff --git a/Documentation/user/memory-areas.rst b/Documentation/user/memory-areas.rst
index 9654a99167..d673f6e1b1 100644
--- a/Documentation/user/memory-areas.rst
+++ b/Documentation/user/memory-areas.rst
@@ -17,11 +17,15 @@ gigabyte.
Examples
--------
-Display a hexdump from 0x80000000 to 0x80001000 (inclusive)::
+Display a hexdump from 0x80000000 to 0x80001000 (inclusive):
+
+.. code-block:: sh
md 0x80000000-0x80001000
-Display 1 kilobyte of memory starting at 0x80000000::
+Display 1 kilobyte of memory starting at 0x80000000:
+
+.. code-block:: sh
md 0x80000000+1k
diff --git a/Documentation/user/system-setup.rst b/Documentation/user/system-setup.rst
index f0598bc2b5..5651569dc2 100644
--- a/Documentation/user/system-setup.rst
+++ b/Documentation/user/system-setup.rst
@@ -16,7 +16,9 @@ for root privileges.
Using the "screen" program
^^^^^^^^^^^^^^^^^^^^^^^^^^
-The terminal manager ``screen`` can also be used as a simple terminal emulator::
+The terminal manager ``screen`` can also be used as a simple terminal emulator:
+
+.. code-block:: sh
screen /dev/ttyUSB0 115200
@@ -31,7 +33,9 @@ from source:
https://git.pengutronix.de/cgit/tools/microcom
-Usage is simple::
+Usage is simple:
+
+.. code-block:: sh
microcom -p /dev/ttyUSB0
@@ -46,7 +50,9 @@ Configuration of dnsmasq for DHCP and TFTP
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The ``dnsmasq`` program can be configured as a DHCP and TFTP server in addition
-to its original DNS functionality::
+to its original DNS functionality:
+
+.. code-block:: sh
sudo ip addr add 192.168.23.1/24 dev <interface>
sudo ip link set <interface> up
diff --git a/Documentation/user/updating.rst b/Documentation/user/updating.rst
index 7aac0a99d6..0555909aa1 100644
--- a/Documentation/user/updating.rst
+++ b/Documentation/user/updating.rst
@@ -11,12 +11,16 @@ A board can register an update handler to the update command. The handler can
do additional checks before trying an update, e.g. it's possible
to check whether the new image actually is a barebox image.
-Updating barebox can be as easy as::
+Updating barebox can be as easy as:
+
+.. code-block:: sh
barebox_update /path/to/new/barebox.img
Multiple handlers can be registered to the update mechanism. Usually the device
-barebox has been started from is registered as default (marked with a ``*``)::
+barebox has been started from is registered as default (marked with a ``*``):
+
+.. code-block:: console
barebox:/ barebox_update -l
registered update handlers:
diff --git a/Documentation/user/variables.rst b/Documentation/user/variables.rst
index e0a79416c6..ddfd485740 100644
--- a/Documentation/user/variables.rst
+++ b/Documentation/user/variables.rst
@@ -12,12 +12,16 @@ The ``global`` device
The ``global`` device is a special purpose device. It only exists as a
storage for global variables. Some global variables are created internally
in barebox (see :ref:`magicvars`). Additional variables can be created with
-the :ref:`command_global` command::
+the :ref:`command_global` command:
+
+.. code-block:: sh
global myvar
This creates the ``global.myvar`` variable which now can be used like any
-other variable. You can also directly assign a value during creation::
+other variable. You can also directly assign a value during creation:
+
+.. code-block:: sh
global myvar1=foobar
@@ -48,7 +52,7 @@ actual values.
examples:
-.. code-block:: sh
+.. code-block:: console
barebox@Phytec phyCARD-i.MX27:/ devinfo nv
barebox@Phytec phyCARD-i.MX27:/ nv model=myboard
@@ -94,7 +98,9 @@ Some variables have special meanings and influence the behaviour
of barebox. Most but not all of them are consolidated in the :ref:`global_device`.
Since it's hard to remember which variables these are and if the current
barebox has support for them the :ref:`command_magicvar` command can print a list
-of all variables with special meaning along with a short description::
+of all variables with special meaning along with a short description:
+
+.. code-block:: console
barebox:/ magicvar
OPTARG optarg for hush builtin getopt