modules/admin-mini: merge last commit
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 9 May 2009 18:21:32 +0000 (18:21 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 9 May 2009 18:21:32 +0000 (18:21 +0000)
modules/admin-mini/luasrc/controller/mini/system.lua

index ad15b07..bb93a34 100644 (file)
@@ -106,6 +106,14 @@ function action_upgrade()
                                        break
                                end
                        end
                                        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
                end
                return size
        end