X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=build%2Fsetup.lua;h=d8fd5ddb9790ddeb6780936ee8a59257594e278a;hp=4a771540da633f0bbb84ba9631c027a165c7cefc;hb=7d0134fedc14794d68c9e9fe9dba60744d8ed8af;hpb=4a6846f0937b6f18c6ffe201910d53eb3ec442ef diff --git a/build/setup.lua b/build/setup.lua index 4a771540d..d8fd5ddb9 100644 --- a/build/setup.lua +++ b/build/setup.lua @@ -12,6 +12,9 @@ uci_model.cursor_state = function() return uci_core.cursor(SYSROOT .. "/etc/config", SYSROOT .. "/var/state") end +uci_model.inst = uci_model.cursor() +uci_model.inst_state = uci_model.cursor_state() + -- override uvl access local uvl_model = require "luci.uvl" local uvl_init = uvl_model.UVL.__init__ @@ -23,3 +26,22 @@ end -- allow any password in local sdk local sys = require "luci.sys" sys.user.checkpasswd = function() return true end + +-- dummy sysinfo on Darwin +require "nixio" + +if not nixio.sysinfo then + function nixio.sysinfo() + return { + bufferram = 0, + freehigh = 0, + freeram = 0, + freeswap = 0, + loads = { 0.0, 0.0, 0.0 }, + mem_unit = 1024, + procs = 0, + sharedram = 0, + totalhigh = 0 + } + end +end