summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-mini/luasrc/controller
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-03 16:33:49 +0000
committerSteven Barth <steven@midlink.org>2008-08-03 16:33:49 +0000
commit15facd92800b6e89bbaaf262bf23c9c6328b2dfd (patch)
tree97a80773026e9115f94734881d44e411a0b3ce48 /modules/admin-mini/luasrc/controller
parentf26e93beadda6cc361c4551777f1d728d9ddfa7d (diff)
modules/admin-*: Fixes for firmware upgrade and system reset
Diffstat (limited to 'modules/admin-mini/luasrc/controller')
-rw-r--r--modules/admin-mini/luasrc/controller/mini/system.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/admin-mini/luasrc/controller/mini/system.lua b/modules/admin-mini/luasrc/controller/mini/system.lua
index e272a1fc77..ef1489b9b1 100644
--- a/modules/admin-mini/luasrc/controller/mini/system.lua
+++ b/modules/admin-mini/luasrc/controller/mini/system.lua
@@ -28,7 +28,7 @@ function index()
end
function action_backup()
- local reset_avail = luci.sys.exec([[grep '"rootfs_data"' /proc/mtd >/dev/null 2>&1]]) == 0
+ local reset_avail = os.execute([[grep '"rootfs_data"' /proc/mtd >/dev/null 2>&1]]) == 0
local restore_cmd = "gunzip | tar -xC/ >/dev/null 2>&1"
local backup_cmd = "tar -c %s | gzip 2>/dev/null"
@@ -81,7 +81,10 @@ function action_upgrade()
local ret = nil
local plat = luci.fs.mtime("/lib/upgrade/platform.sh")
+ local broadcom = os.execute('grep brcm_ /lib/upgrade/platform.sh >/dev/null 2>&1') == 0
local tmpfile = "/tmp/firmware.img"
+
+ local keep_avail = not broadcom
local file
luci.http.setfilehandler(
@@ -99,13 +102,13 @@ function action_upgrade()
)
local fname = luci.http.formvalue("image")
- local keepcfg = luci.http.formvalue("keepcfg")
+ local keepcfg = keep_avail and luci.http.formvalue("keepcfg")
if plat and fname then
ret = luci.sys.flash(tmpfile, keepcfg and _keep_pattern())
end
- luci.template.render("mini/upgrade", {sysupgrade=plat, ret=ret})
+ luci.template.render("mini/upgrade", {sysupgrade=plat, ret=ret, keep_avail=keep_avail})
end
function action_passwd()