Topic: Making LUCI work on Debian (not OpenWRT)


I thought some of you might help, although this is an OpenWRT forum.

What I have:
I am developing a device (not a router!) which is based on a PC104 ARM processor. It essentially has a Debian based OS with just a custom kernel. I have a thttpd installed and running no problem.

What I want:
I would like to use LuCI web interface on my system to configure the different settings on the device.

What I did:
I downloaded LuCI 0.10 from svn. Then, I downloaded the packages like ncurses-dev and others, so "make" worked well.

Now, I am really sure what to do next - the directory now has a "host" directory. My logic says I need to copy that to the / of my machine. I don't really want to screw things up and I have not found anything that answers my questions on google.

I'd like someone to give me an idea of direction and what to do next.
Also, I still have a small doubt: Once installed, I plan to add "plugins" as pages to configure different equipment attached to the machine by writing text configuration files to disk. Is LuCI capable of this, or should I just develop something custom?

Thank you.

Re: Making LUCI work on Debian (not OpenWRT)

The LuCI build system assumes a certain structure on your target device:
- /www - the docroot of the httpd
- /www/cgi-bin - a directory which supports traditional cgi
- /usr/lib/lua - the search path for Lua modules

Despite the fact that LuCI is tailored for the UCI system you can still use the config independant parts (template engine, http handling, utility modules) to build an ui for an entirely different host system - you cannot however use much of the existing admin pages since those are built around the respective configuration files and complementary init scripts implementing the actual translation logic.

So you would basically need to prepare your host system as follows:
- Prepare an httpd serving pages from /www and plain CGI 1.1 from /www/cgi-bin
- Install vanilla Lua 5.1(!) and configure it to search modules in /usr/lib/lua (either by symlinking or recompiling with appropriate configure flags)
- Copy the contents of the host/ directory to your target rootfs

Be aware that some LuCI modules (template parser, nixio) are compiled from C source, so you have to pass appropriate CFLAGS, LDFLAGS to make in order to ensure proper cross compilation for the target architrcture.
Refer to build/ for applicable vars.

Re: Making LUCI work on Debian (not OpenWRT)

Regarding the development of your custom plugins for certain peripherals there are basically two main approaches to choose from:

1) implement uci on your target the same way OpenWrt does it and use LuCIs CBI to build forms
2) develop LuCI addons "php-like" and hand-write form html and value processing logic

Which one is less effort depends on the nature of the covered configuration. CBI is useful for configs consisting of a few standard data types like select boxes, checkbox, input field while habdwritten HTML becomes easier to use if you need many custom widgets like sliders orinterdependant choice lists etc.

Re: Making LUCI work on Debian (not OpenWRT)

Thank you for the replies. I have evaluated LuCI further and decided that adapting it to what I need would be too much work. If anyone ever googles this for some reason, I ended up choosing webmin.