Using UCI as stand alone
UCI (Unified Configuration Interface) can be used as stand alone. With this you can make use of UCI in your own distribution. It's also useful in the future for writing and testing OpenWrt UCI configuration files and init scripts on a Linux box instead on the router.
UCI is maintained by nbd (Felix Fietkau) at http://nbd.name/gitweb.cgi?p=uci.git;a=summary
Checkout and compile UCI
cd ~
git clone git://nbd.name/uci.git ~/uci/
cd ~/uci/
make
sudo make install
sudo mkdir -p /etc/config
Example UCI config file (/etc/config/test):
config 'test' 'abc'
option 'test_var' 'value'
openwrt@ubuntu-laptop:~/uci$ uci show test
test.abc=test
test.abc.test_var=value
openwrt@ubuntu-laptop:~/uci$ uci set test.abc.test_var=foobar
openwrt@ubuntu-laptop:~/uci$ sudo uci commit test
openwrt@ubuntu-laptop:~/uci$ uci show test
test.abc=test
test.abc.test_var=foobar
Notes
* Currently the config path is hardcoded to /etc/config/
* Init script related files such as rc.common has to be fixed to run as stand alone
(Last edited by forum2008 on 13 Apr 2008, 15:41)