Skip to content
Snippets Groups Projects
Unverified Commit 75ceb0d9 authored by Tom Herbers's avatar Tom Herbers Committed by GitHub
Browse files

web-admin: ignore minor compat-version on upgrade (#2590)

This implements the same behavior as it is used in the autoupdater [1].

This is for example required to allow the manual installation of
firmware upgrades via the config mode on devices which where migrated
from swconfig to DSA. Otherwise the image will always be invalid.

[1] https://github.com/freifunk-gluon/packages/commit/b80428166454d184f356e5a14a144911d9ee11aa
parent 20eea9b9
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ local unistd = require 'posix.unistd' ...@@ -17,6 +17,7 @@ local unistd = require 'posix.unistd'
local file local file
local tmpfile = "/tmp/firmware.img" local tmpfile = "/tmp/firmware.img"
local compat_option = "--ignore-minor-compat-version"
local function filehandler(_, chunk, eof) local function filehandler(_, chunk, eof)
...@@ -64,7 +65,7 @@ local function action_upgrade(http, renderer) ...@@ -64,7 +65,7 @@ local function action_upgrade(http, renderer)
end end
local function image_supported(supported_tmpfile) local function image_supported(supported_tmpfile)
return (os.execute(string.format("exec /sbin/sysupgrade -T %q >/dev/null", supported_tmpfile)) == 0) return (os.execute(string.format("exec /sbin/sysupgrade -T %s %q >/dev/null", compat_option, supported_tmpfile)) == 0)
end end
local function storage_size() local function storage_size()
...@@ -122,7 +123,7 @@ local function action_upgrade(http, renderer) ...@@ -122,7 +123,7 @@ local function action_upgrade(http, renderer)
}, 'gluon-web-admin') }, 'gluon-web-admin')
elseif step == 3 then elseif step == 3 then
local cmd = {[0] = '/sbin/sysupgrade', tmpfile} local cmd = {[0] = '/sbin/sysupgrade', compat_option, tmpfile}
if http:formvalue('keepcfg') ~= '1' then if http:formvalue('keepcfg') ~= '1' then
table.insert(cmd, 1, '-n') table.insert(cmd, 1, '-n')
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment