projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
modules/admin-{mini,full}: start sysupgrade in background
[project/luci.git]
/
modules
/
admin-mini
/
luasrc
/
controller
/
mini
/
system.lua
diff --git
a/modules/admin-mini/luasrc/controller/mini/system.lua
b/modules/admin-mini/luasrc/controller/mini/system.lua
index
93f113a
..
44d0688
100644
(file)
--- a/
modules/admin-mini/luasrc/controller/mini/system.lua
+++ b/
modules/admin-mini/luasrc/controller/mini/system.lua
@@
-151,21
+151,15
@@
function action_upgrade()
if has_platform and has_image and has_support then
-- Mimetype text/plain
luci.http.prepare_content("text/plain")
if has_platform and has_image and has_support then
-- Mimetype text/plain
luci.http.prepare_content("text/plain")
+ luci.http.write("Starting luci-flash...\n")
-- Now invoke sysupgrade
local keepcfg = keep_avail and luci.http.formvalue("keepcfg") == "1"
-- Now invoke sysupgrade
local keepcfg = keep_avail and luci.http.formvalue("keepcfg") == "1"
- local f
d = io.
popen("/sbin/luci-flash %s %q" %{
+ local f
lash = ltn12_
popen("/sbin/luci-flash %s %q" %{
keepcfg and "-k %q" % _keep_pattern() or "", tmpfile
})
keepcfg and "-k %q" % _keep_pattern() or "", tmpfile
})
- if fd then
- while true do
- local ln = fd:read("*l")
- if not ln then break end
- luci.http.write(ln .. "\n")
- end
- fd:close()
- end
+ luci.ltn12.pump.all(flash, luci.http.write)
-- Make sure the device is rebooted
luci.sys.reboot()
-- Make sure the device is rebooted
luci.sys.reboot()