From 2f9cbf7d055e404382ea38932c16e63f2ac9f28b Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 17 Jun 2009 12:48:18 +0000 Subject: [PATCH] modules/admin-mini: merge r4865 to admin-mini --- modules/admin-mini/luasrc/controller/mini/system.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/admin-mini/luasrc/controller/mini/system.lua b/modules/admin-mini/luasrc/controller/mini/system.lua index bb93a34c4..3aae6fa2f 100644 --- a/modules/admin-mini/luasrc/controller/mini/system.lua +++ b/modules/admin-mini/luasrc/controller/mini/system.lua @@ -149,15 +149,21 @@ function action_upgrade() -- previous pages should arrange the stuff as required. if step == 4 then if has_platform and has_image and has_support then - -- Next line is to bypass luci.http layer - luci.http.context.eoh = true - -- Now invoke sysupgrade local keepcfg = keep_avail and luci.http.formvalue("keepcfg") == "1" - os.execute("/sbin/luci-flash %s %q" %{ + local fd = io.popen("/sbin/luci-flash %s %q" %{ 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) + end + fd:close() + end + -- Make sure the device is rebooted luci.sys.reboot() end -- 2.11.0