web-admin: fix firmware partition name

The rudimentary flash size determination function expects the partition
for the devices firmware to be called "linux" while it is (since quite
some time) "firmware".

Fix this error to display available flash size as well as more useful
error message in case the uploaded firmware image exceeds the flash
space.

Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
David Bauer 2021-05-01 02:53:03 +02:00
parent 4cd644a7a8
commit d0551c2dcd

View File

@ -72,7 +72,7 @@ local function action_upgrade(http, renderer)
if unistd.access("/proc/mtd") then if unistd.access("/proc/mtd") then
for l in io.lines("/proc/mtd") do for l in io.lines("/proc/mtd") do
local s, n = l:match('^[^%s]+%s+([^%s]+)%s+[^%s]+%s+"([^%s]+)"') local s, n = l:match('^[^%s]+%s+([^%s]+)%s+[^%s]+%s+"([^%s]+)"')
if n == "linux" then if n == "firmware" then
size = tonumber(s, 16) size = tonumber(s, 16)
break break
end end