summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-admin-full/luasrc/controller
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-mod-admin-full/luasrc/controller')
-rw-r--r--modules/luci-mod-admin-full/luasrc/controller/admin/system.lua14
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua b/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua
index 153615b58a..b278b21878 100644
--- a/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua
+++ b/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua
@@ -269,15 +269,17 @@ function action_sysupgrade()
--
-- Initiate firmware flash
--
- local step = tonumber(http.formvalue("step") or 1)
+ local step = tonumber(http.formvalue("step")) or 1
if step == 1 then
- if image_supported(image_tmp) then
+ local force = http.formvalue("force")
+ if image_supported(image_tmp) or force then
luci.template.render("admin_system/upgrade", {
checksum = image_checksum(image_tmp),
sha256ch = image_sha256_checksum(image_tmp),
storage = storage_size(),
size = (fs.stat(image_tmp, "size") or 0),
- keep = (not not http.formvalue("keep"))
+ keep = (not not http.formvalue("keep")),
+ force = (not not http.formvalue("force"))
})
else
fs.unlink(image_tmp)
@@ -287,17 +289,19 @@ function action_sysupgrade()
image_invalid = true
})
end
+
--
-- Start sysupgrade flash
--
elseif step == 2 then
local keep = (http.formvalue("keep") == "1") and "" or "-n"
+ local force = (http.formvalue("force") == "1") and "" or "-F"
luci.template.render("admin_system/applyreboot", {
title = luci.i18n.translate("Flashing..."),
msg = luci.i18n.translate("The system is flashing now.<br /> DO NOT POWER OFF THE DEVICE!<br /> Wait a few minutes before you try to reconnect. It might be necessary to renew the address of your computer to reach the device again, depending on your settings."),
- addr = (#keep > 0) and "192.168.1.1" or nil
+ addr = (#keep > 0) and (#force > 0) and "192.168.1.1" or nil
})
- fork_exec("sleep 1; killall dropbear uhttpd; sleep 1; /sbin/sysupgrade %s %q" %{ keep, image_tmp })
+ fork_exec("sleep 1; killall dropbear uhttpd; sleep 1; /sbin/sysupgrade %s %s %q" %{ keep, force, image_tmp })
end
end