summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-full/luasrc/controller
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-05-09 18:18:22 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-05-09 18:18:22 +0000
commitaac40a4dfa36c7f8204d39a26bf8d32cdca0f5ab (patch)
treec14ae901fd54ddd0dbae1d360816c6830dd92589 /modules/admin-full/luasrc/controller
parent64600a27ee42298c44867e9af67ac69797e7b5e1 (diff)
modules/admin-full: determine storage space from /proc/partitions if there's no /proc/mtd
Diffstat (limited to 'modules/admin-full/luasrc/controller')
-rw-r--r--modules/admin-full/luasrc/controller/admin/system.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/admin-full/luasrc/controller/admin/system.lua b/modules/admin-full/luasrc/controller/admin/system.lua
index 33e46b74b..ff000ab75 100644
--- a/modules/admin-full/luasrc/controller/admin/system.lua
+++ b/modules/admin-full/luasrc/controller/admin/system.lua
@@ -214,6 +214,14 @@ function action_upgrade()
break
end
end
+ elseif luci.fs.access("/proc/partitions") then
+ for l in io.lines("/proc/partitions") do
+ local x, y, b, n = l:match('^%s*(%d+)%s+(%d+)%s+([^%s]+)%s+([^%s]+)')
+ if b and n and not n:match('[0-9]') then
+ size = tonumber(b) * 1024
+ break
+ end
+ end
end
return size
end