From c552de4beba5222cdb2f20a0fe5323927d9f7276 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 1 Apr 2016 14:13:41 +0200 Subject: [PATCH] add basic uci docs Signed-off-by: John Crispin --- docs/header.txt | 2 +- docs/uci.txt | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 docs/uci.txt diff --git a/docs/header.txt b/docs/header.txt index 7ed3eb6..db06e3c 100644 --- a/docs/header.txt +++ b/docs/header.txt @@ -1,5 +1,5 @@ == image:../logo/logo_small.png[width="39"] Linux Embedded Developement Environment |==== -^| link:index.html[Index] ^| link:ubus.html[uBus] ^| link:procd.html[Procd] +^| link:index.html[Index] ^| link:uci.html[Configuration] ^| link:ubus.html[uBus] ^| link:procd.html[Procd] |==== diff --git a/docs/uci.txt b/docs/uci.txt new file mode 100644 index 0000000..61887c3 --- /dev/null +++ b/docs/uci.txt @@ -0,0 +1,43 @@ +include::header.txt[] + +== UCI - Unified Configuration Interface + +_LEDE_ uses UCI to store its configuration. This is a human readable file format using typed and named section. Each section contains a number of options. Options can be single values or list of values. All configuration files are stored in the /etc/config/ folder. You can manually edit these files. + +---- +root@lede:/# cat etc/config/system +config system + option hostname lede + option timezone UTC + +config timeserver ntp + list server 0.openwrt.pool.ntp.org + list server 1.openwrt.pool.ntp.org + list server 2.openwrt.pool.ntp.org + list server 3.openwrt.pool.ntp.org + option enabled 1 + option enable_server 0 +---- + +Alternatively you may use the uci CLI to read/modify their content. Using the CLI has the advantage that you do not need to worry about the validity of the syntax. Some user do however prefer to make changes manually, they should however be aware that even minor syntax errors will make the whole file unparsable and not just the specific section and/or option that was modified. + +---- +root@lede:/# uci show system +system.@system[0]=system +system.@system[0].hostname='lede' +system.@system[0].timezone='UTC' +system.ntp=timeserver +system.ntp.server='0.openwrt.pool.ntp.org' '1.openwrt.pool.ntp.org' '2.openwrt.pool.ntp.org' '3.openwrt.pool.ntp.org' +system.ntp.enabled='1' +system.ntp.enable_server='0' +---- + +When using the CLI to modify values, you will find that all changes first get staged and not commited to the file directly. If you want to permanently store changes you need to commit them. After calling the commit command, you can also make the system reload and apply the changes that you made + +---- +root@lede:/# uci set system.@system[0].hostname=foo +root@lede:/# uci commit +root@lede:/# reload_config +root@lede:/# +root@foo:/# +---- -- 2.30.2