lua-platform-info: add support for the mpc85xx-generic target

This commit is contained in:
Matthias Schiffer 2014-08-08 17:49:50 +02:00
parent 3c237e2721
commit 5afa7ae59d
2 changed files with 38 additions and 1 deletions

View File

@ -12,7 +12,7 @@ define Package/lua-platform-info
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Lua hardware platform information library
DEPENDS:=+lua @TARGET_ar71xx_generic
DEPENDS:=+lua @(TARGET_ar71xx_generic||TARGET_mpc85xx_generic)
endef
define Package/lua-platform-info/description

View File

@ -0,0 +1,37 @@
local function read_line(file)
local f = io.open(file)
local ret = f:read('*line')
f:close()
return ret
end
local board_name = read_line('/tmp/sysinfo/board_name')
local model = read_line('/tmp/sysinfo/model')
module 'platform_info'
-- The OpenWrt target
function get_target()
return 'mpc85xx'
end
-- The OpenWrt subtarget or nil
function get_subtarget()
return 'generic'
end
-- The board name
function get_board_name()
return board_name
end
-- The model name
function get_model()
return model
end
-- The image name for sysupgrades
function get_image_name()
return (model:lower():gsub('[^%w]+', '-'):gsub('%-+$', ''))
end