소스 검색

gluon-luci-admin: Fix uploaded image validation

The image validation currently fails on some devices (tested OpenMesh)
because it isn't done via sysupgrade. But the checks depend partially on
the integration in sysupgrade (e.g. via loops that can be stopped via
"break statements").

Instead of hacking its own version check, it is easier and better tested to
just use 'sysupgrade -T' like it is already done by LuCI.

Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
Sven Eckelmann 8 년 전
부모
커밋
e76efb2659
1개의 변경된 파일1개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 3
      package/gluon-luci-admin/files/usr/lib/lua/luci/controller/admin/upgrade.lua

+ 1 - 3
package/gluon-luci-admin/files/usr/lib/lua/luci/controller/admin/upgrade.lua

@@ -101,9 +101,7 @@ end
 function image_supported(tmpfile)
 	-- XXX: yay...
 	return ( 0 == os.execute(
-		". /lib/functions.sh; " ..
-		"include /lib/upgrade; " ..
-		"platform_check_image %q >/dev/null"
+		"/sbin/sysupgrade -T %q >/dev/null"
 			% tmpfile
 	) )
 end