diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2020-11-10 16:34:29 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-11-13 08:53:40 +0100 |
commit | 4fd3686373e842ac3e43b53ca5280b38e5a3d96b (patch) | |
tree | 05de1fe191d1fbf7f85d155a26541ea04dd28094 | |
parent | d0f535b6a60a32683336b834837840615d0891f8 (diff) | |
download | barebox-4fd3686373e842ac3e43b53ca5280b38e5a3d96b.tar.gz barebox-4fd3686373e842ac3e43b53ca5280b38e5a3d96b.tar.xz |
doc: add note about characters like hyphens in variable names
The mismatch between the allowed characters in shell variables and
device parameters is a common pitfall, especially because device
tree node names often have hyphens in them, which is disallowed by
hush.
While such variables can be read by the ${variable-example}, setting
them is only possible with the setenv command. Reflect this in the
documentation.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | Documentation/user/driver-model.rst | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Documentation/user/driver-model.rst b/Documentation/user/driver-model.rst index a0fd3e99b5..c543d6d9c4 100644 --- a/Documentation/user/driver-model.rst +++ b/Documentation/user/driver-model.rst @@ -88,7 +88,14 @@ The parameters can be used as shell variables: .. code-block:: sh eth0.ipaddr=192.168.23.15 - echo "my current ip is: $eth0.ipaddr" + echo "my current ip is: ${eth0.ipaddr}" + +.. note:: + + Hush shell syntax for defining and setting variables is the same, so + some characters such as hyphens are not allowed on the left hand side + of a shell variable assignment. :ref:`command_setenv`, if enabled, + can still be used to write such a variable though. device variables may have a type, so assigning wrong values may fail: |