path: root/commands/nv.c
Commit message (Collapse)AuthorAgeFilesLines
* nv: add device parameter overwrites to completion listSascha Hauer2017-11-231-1/+1
| | | | | | | | nv variables in the form dev.<devname>.* can be used to make device parameters persistent. Add these to the completion list to make setting these variables more convenient. Signed-off-by: Sascha Hauer <>
* command: nv: rewrap help text linesEnrico Jorns2017-11-031-3/+3
| | | | | | | Just let the help text appear a bit more aligned. Signed-off-by: Enrico Jorns <> Signed-off-by: Sascha Hauer <>
* commands: nv: adjust command helpEnrico Jorns2017-11-031-5/+5
| | | | | | | | | | Help did not point out that -r option requires n arguments and did not mention support for removing variables in help text. Also introduce and consistently reuse 'NV' as abbreviation for 'non volatile'. Signed-off-by: Enrico Jorns <> Signed-off-by: Sascha Hauer <>
* commands: nv: assure error code will be returned when an error occurredEnrico Jorns2017-11-031-4/+14
| | | | | | | | | | | | | | Due to iteration over possibly multiple variables, the return value of an individual call to nvvar_remove() / nvvar_add() gets lost. This will result in do_nv() returning success (0) if any variable processing failed as long as processing of the last variable succeeded. Processing will not be aborted on individual errors, such as the 'cp' handles it for invalid files. Signed-off-by: Enrico Jorns <> Signed-off-by: Sascha Hauer <>
* commands: nv: call nvvar_print() only if no argument is givenEnrico Jorns2017-11-031-4/+5
| | | | | | | | Printing the nv variables (before performing any modification!) is useless and irritating. Signed-off-by: Enrico Jorns <> Signed-off-by: Sascha Hauer <>
* commands: nv: fail with verbose message if invoked without argsEnrico Jorns2017-11-031-1/+3
| | | | | Signed-off-by: Enrico Jorns <> Signed-off-by: Sascha Hauer <>
* complete: Add completion for nv and globalvar commandsSascha Hauer2016-10-181-0/+2
| | | | | | | | The 'nv' command is often used to create a nv variable for an existing global variable, so add a command completion function for this. Signed-off-by: Sascha Hauer <>
* nv: Allow to set/remove multiple variables with one commandSascha Hauer2016-07-221-13/+15
| | | | | | | | It's convenient to set/remove multiple nv variables in one go. With this patch we iterate over the remaining nonopts instead of expecting exactly one nonopt. Signed-off-by: Sascha Hauer <>
* nv: Add option to explicitly save nv variablesSascha Hauer2016-07-221-4/+11
| | | | | | | | | We now have code to save the nv variables without saving the rest of the environment. This gives us the possibility to explicitly save the nv variables. This patch adds an option to the 'nv' command for this. Signed-off-by: Sascha Hauer <>
* Add support for non volatile variablesSascha Hauer2014-11-061-0/+84
This adds (back) support for non volatile variables. Non volatile variables are variables which are stored in the environment over reboot. They are used in the same way as the global variables, but with a 'nv' command and device. The variables are stored under /env/nv/, one variable per file. Adding a nv variable automatically adds a global variable with the same name. Changing a nv variable also changes the same global variable, but not the other way round. This allows for example to configure the username as: nv user=sha; saveenv Signed-off-by: Sascha Hauer <>