User Tools

Site Tools


docs:techref:uci

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
docs:techref:uci [2018/03/03 20:30]
188.166.177.185 ↷ Links adapted because of a move operation
docs:techref:uci [2018/08/09 10:24] (current)
karlp dropped rambling raspbian/ubuntu instructions
Line 314: Line 314:
 ===== Usage outside of  OpenWrt ===== ===== Usage outside of  OpenWrt =====
 If you want to use the libuci apart from OpenWrt (for e.g. you are developing an application in C on your host computer) then prepare as follows: If you want to use the libuci apart from OpenWrt (for e.g. you are developing an application in C on your host computer) then prepare as follows:
 +Note that libuci depends on [libubox]
  
 Grab the source. Grab the source.
Line 324: Line 325:
 Build and install uci as root (this will install uci into /​usr/​local/,​ see this thread on how to install and use uci without root permissions in your home directory: https://​forum.openwrt.org/​viewtopic.php?​id=40547):​ Build and install uci as root (this will install uci into /​usr/​local/,​ see this thread on how to install and use uci without root permissions in your home directory: https://​forum.openwrt.org/​viewtopic.php?​id=40547):​
 <​code>​make install</​code>​ <​code>​make install</​code>​
 +
 +**Setup library search paths using ''​ld.so.conf''​**
 +
 +Setting your system library search path can be done in many ways, and is largely out of scope of the OpenWrt wiki.
  
 Open /​etc/​ld.so.conf and add the place where you installed the uci library: Open /​etc/​ld.so.conf and add the place where you installed the uci library:
Line 333: Line 338:
 Execute ldconfig as root to apply the changes to /​etc/​ld.so.conf Execute ldconfig as root to apply the changes to /​etc/​ld.so.conf
 <​code>​ldconfig</​code>​ <​code>​ldconfig</​code>​
 +
 +**Setup library search paths using ''​Using LD_LIBRARY_PATH''​**
 +
 +Alternatively,​ just <​code>​export LD_LIBRARY_PATH=<​where/​you/​installed/​the/​.so></​code>​
 +
 +
 +**Building your own application**
  
 To compile your application you have to link it against the uci library. Append -luci in your Makefile: To compile your application you have to link it against the uci library. Append -luci in your Makefile:
Line 341: Line 353:
  
  
-===== Make UCI in UBUNTU 16.04 , Raspbian Jessie or similar===== 
-If you want to use uci in Debian, UBUNTU or similar, ​ do the following steps: 
- 
-First make a directory for download source codes: 
-<​code>​ 
-mkdir ~/​Desktop/​uci 
-</​code>​ 
- 
-**1- Install json-c** 
- 
-Install the required packages: 
-<​code>​ 
-sudo apt-get install dh-autoreconf git 
-</​code>​ 
- 
-Download source code: 
-<​code>​ 
-cd ~/​Desktop/​uci 
-git clone https://​github.com/​json-c/​json-c.git 
-</​code>​ 
- 
-Make and install json-c: 
-<​code>​ 
-cd json-c 
-sh ./​autogen.sh 
-./configure 
-make 
-sudo make install 
-make check 
-</​code>​ 
- 
-**2- Install libubox** 
- 
-Install the required packages: 
-<​code>​ 
-sudo apt-get install lua5.1 liblua5.1-0-dev cmake 
-</​code>​ 
- 
-Download source code: 
-<​code>​ 
-cd ~/​Desktop/​uci 
-git clone https://​git.openwrt.org/​project/​libubox.git 
-</​code>​ 
- 
-Make and install libubox: 
-<​code>​ 
-cd libubox 
-cmake . 
-make 
-sudo make install 
-</​code>​ 
- 
-**3- Install uci** 
- 
-Download source code: 
-<​code>​ 
-cd ~/​Desktop/​uci 
-git clone https://​git.openwrt.org/​project/​uci.git 
-</​code>​ 
- 
-Make and install uci: 
-<​code>​ 
-cd uci 
-cmake . 
-sudo make install 
-</​code>​ 
- 
-Now u can use uci : 
-<​code>​ 
-uci 
-</​code>​ 
- 
-If you still see this message: 
-<​code>​ 
-error while loading shared libraries: libubox.so: cannot open shared object file: No such file or directory 
-</​code>​ 
- 
-edit this file: 
-<​code>​ 
-sudo nano /​etc/​environment 
-</​code>​ 
- 
-Add this command into it: 
-<​code>​ 
-LD_LIBRARY_PATH=/​usr/​local/​lib 
-</​code>​ 
- 
-or this file 
-<​code>​ 
-sudo nano /​etc/​profile 
-</​code>​ 
- 
-Add these commands into it: 
-<​code>​ 
-LD_LIBRARY_PATH=/​usr/​local/​lib 
-export LD_LIBRARY_PATH 
-</​code>​ 
- 
-This will let you restart your computer. 
  
 ===== Functioning ===== ===== Functioning =====
docs/techref/uci.txt · Last modified: 2018/08/09 10:24 by karlp