Hi folks,
I'm struggling to add new menu item to luci for a couple of days, but I'm unsuccesful. Here is what I did:
- downloaded and compiled an own openwrt by doing the things found on http://wiki.openwrt.org/doc/howto/easy.build
I changed the svn command from attitude_adjustment to
svn co -r 42625 svn://svn.openwrt.org/openwrt/branches/barrier_breaker
I skipped the "Disable unnecessary packages" section.
It compiled ok, I was successful to flash the newly compiled firmware, router is working.
===
Then I followed instructions found on http://wiki.openwrt.org/doc/devel/luci character-by-character.
It was unsuccessful, new menu item didn't appeared, nor was it accessible by url.
make menuconfig didn't recognize this new app.
(I think there is an error in the above page, in the "Adding the cbi_tab code" section there is a path saying "/luci-myapplication/model/cbi/myapp-mymodule" - it should be "/luci-myapplication/luasrc/model/cbi/myapp-mymodule". I tried both ways with and without luasrc but none of these was working.)
===
Next I tried to "clone" and simplify the luci-commands application, by putting the following directory structure under feeds/luci/applications (asterisks are for indent only)
*luci-testapp
**luasrc
***controller
****testapp.lua
***view
****testapp.htm
testapp.lua contains:
module("luci.controller.testapp", package.seeall)
function index()
entry({"admin", "system", "testapp"}, firstchild(), _("TestApp"), 82)
entry({"admin", "system", "testapp", "base"}, template("testapp"), _("Base"), 1)
end
testapp.htm contains:
<%+header%>
<h1><%:Hello World%></h1>
<%+footer%>
make menuconfig does not recognize it and there's no any traces of the above stuff in the compiled firmware (no menuitem, no url, file system does not contain anything of testapp).
===
Although http://wiki.openwrt.org/doc/devel/luci does not say anything about Makefile, finally I created a Makefile under feeds/luci/applications/luci-testapp because I saw it in other app dirs:
PO = testapp
include ../../build/config.mk
include ../../build/module.mk
The case was the same as above.
===
What am I missing? What have I do differently to create a new luci menu item?
Thanks a lot!