Merge pull request #302 from chris5560/master
[project/luci.git] / modules / luci-mod-admin-full / luasrc / controller / admin / system.lua
index 0b202a8..52e347d 100644 (file)
@@ -1,5 +1,5 @@
 -- Copyright 2008 Steven Barth <steven@midlink.org>
--- Copyright 2008-2011 Jo-Philipp Wich <xm@subsignal.org>
+-- Copyright 2008-2011 Jo-Philipp Wich <jow@openwrt.org>
 -- Licensed to the public under the Apache License 2.0.
 
 module("luci.controller.admin.system", package.seeall)
@@ -178,13 +178,7 @@ function action_flashops()
        local image_tmp   = "/tmp/firmware.img"
 
        local function image_supported()
-               -- XXX: yay...
-               return ( 0 == os.execute(
-                       ". /lib/functions.sh; " ..
-                       "include /lib/upgrade; " ..
-                       "platform_check_image %q >/dev/null"
-                               % image_tmp
-               ) )
+               return (os.execute("sysupgrade -T %q >/dev/null" % image_tmp) == 0)
        end
 
        local function image_checksum()