OXYGEN #1: Added index-marks
[project/luci.git] / modules / admin-mini / luasrc / controller / mini / system.lua
index 6d16ef8650e22c91e7ea1616f20384f8ccb5d4dd..9d0ef0c639a039d14cba96cadc3c8b470a915900 100644 (file)
@@ -19,7 +19,7 @@ function index()
        luci.i18n.loadc("admin-core")
        local i18n = luci.i18n.translate
 
-       entry({"mini", "system"}, alias("mini", "system", "index"), i18n("system"), 40)
+       entry({"mini", "system"}, alias("mini", "system", "index"), i18n("system"), 40).index = true
        entry({"mini", "system", "index"}, cbi("mini/system"), i18n("general"), 1)
        entry({"mini", "system", "passwd"}, form("mini/passwd"), i18n("a_s_changepw"), 10)
        entry({"mini", "system", "backup"}, call("action_backup"), i18n("a_s_backup"), 80)
@@ -82,9 +82,7 @@ function action_upgrade()
        local ret  = nil
        local plat = luci.fs.mtime("/lib/upgrade/platform.sh")
        local tmpfile = "/tmp/firmware.img"
-       local broadcom = os.execute('grep brcm_ /lib/upgrade/platform.sh >/dev/null 2>&1') == 0
-        
-       local keep_avail = not broadcom
+       local keep_avail = true
 
        local file
        luci.http.setfilehandler(
@@ -110,6 +108,7 @@ function action_upgrade()
                end
        end
 
+       luci.http.prepare_content("text/html")
        luci.template.render("mini/upgrade", {sysupgrade=plat, ret=ret, keep_avail=keep_avail})
 end
 
@@ -118,9 +117,11 @@ function _keep_pattern()
        local files = luci.model.uci.cursor():get_all("luci", "flash_keep")
        if files then
                kpattern = ""
-               for k,v in pairs(files) do
-                       kpattern = kpattern .. " " ..  v
+               for k, v in pairs(files) do
+                       if k:sub(1,1) ~= "." and luci.fs.glob(v) then
+                               kpattern = kpattern .. " " ..  v
+                       end
                end
        end
        return kpattern
-end
+end
\ No newline at end of file