Changeset 4500

Show
Ignore:
Timestamp:
05/09/09 19:18:22 (4 years ago)
Author:
jow
Message:

modules/admin-full: determine storage space from /proc/partitions if there's no /proc/mtd

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/modules/admin-full/luasrc/controller/admin/system.lua

    r4486 r4500  
    215215                end 
    216216            end 
     217        elseif luci.fs.access("/proc/partitions") then 
     218            for l in io.lines("/proc/partitions") do 
     219                local x, y, b, n = l:match('^%s*(%d+)%s+(%d+)%s+([^%s]+)%s+([^%s]+)') 
     220                if b and n and not n:match('[0-9]') then 
     221                    size = tonumber(b) * 1024 
     222                    break 
     223                end 
     224            end 
    217225        end 
    218226        return size