diff options
Diffstat (limited to 'libs')
-rwxr-xr-x | libs/httpd/host/runluci | 10 | ||||
-rw-r--r-- | libs/sgi-webuci/root/usr/lib/boa/luci.lua | 10 |
2 files changed, 13 insertions, 7 deletions
diff --git a/libs/httpd/host/runluci b/libs/httpd/host/runluci index 1d5812679..6f6cdde3d 100755 --- a/libs/httpd/host/runluci +++ b/libs/httpd/host/runluci @@ -4,19 +4,25 @@ require("luci.httpd.server") require("luci.httpd.handler.file") require("luci.httpd.handler.luci") -DOCROOT = arg[1] +SYSROOT = arg[1] +DOCROOT = SYSROOT .. arg[2] PORT = 8080 collectgarbage("setpause", 150) serversocket = luci.httpd.Socket("0.0.0.0", PORT) - server = luci.httpd.server.Server() vhost = luci.httpd.server.VHost() server:set_default_vhost(vhost) +if pcall(require, "uci") and pcall(require, "luci.model.uci") then + luci.model.uci.confdir_default = SYSROOT .. luci.model.uci.confdir_default + luci.model.uci.savedir_state = SYSROOT .. luci.model.uci.savedir_state + luci.model.uci.set_confdir(luci.model.uci.confdir_default) +end + filehandler = luci.httpd.handler.file.Simple(DOCROOT) vhost:set_default_handler(filehandler) diff --git a/libs/sgi-webuci/root/usr/lib/boa/luci.lua b/libs/sgi-webuci/root/usr/lib/boa/luci.lua index 5c9531a2e..d0f4323c3 100644 --- a/libs/sgi-webuci/root/usr/lib/boa/luci.lua +++ b/libs/sgi-webuci/root/usr/lib/boa/luci.lua @@ -20,12 +20,13 @@ function init(path) require("luci.dispatcher") require("luci.sgi.webuci") - require("uci") + require("luci.model.uci") if (root ~= '/') then -- Entering dummy mode - uci.set_savedir(root..'/tmp/.uci') - uci.set_confdir(root..'/etc/config') + luci.model.uci.confdir_default = root .. '/etc/config' + luci.model.uci.savedir_state = root .. '/var/state' + uci.set_confdir(luci.model.uci.confdir_default) luci.sys.hostname = function() return "" end luci.sys.loadavg = function() return 0,0,0,0,0 end @@ -35,12 +36,11 @@ function init(path) luci.sys.net.arptable = function() return {} end luci.sys.net.devices = function() return {} end - luci.sys.net.routes = function() return {} end + luci.sys.net.routes = function() return {} end luci.sys.wifi.getiwconfig = function() return {} end luci.sys.wifi.iwscan = function() return {} end luci.sys.user.checkpasswd = function() return true end - luci.http.basic_auth = function() return true end end end |