From: Jo-Philipp Wich Date: Sat, 9 May 2009 18:18:22 +0000 (+0000) Subject: modules/admin-full: determine storage space from /proc/partitions if there's no ... X-Git-Tag: 0.9.0~467 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=aac40a4dfa36c7f8204d39a26bf8d32cdca0f5ab;p=oweals%2Fluci.git modules/admin-full: determine storage space from /proc/partitions if there's no /proc/mtd --- 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