Merge branch 'for-2015.x'

This commit is contained in:
Nils Schneider 2014-12-31 18:17:45 +01:00
commit a1d8c7ea0f
2 changed files with 33 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||TARGET_mpc85xx_generic||TARGET_x86_generic)
DEPENDS:=+lua @(TARGET_ar71xx_generic||TARGET_mpc85xx_generic||TARGET_x86_generic||TARGET_ramips_rt305x)
endef
define Package/lua-platform-info/description

View File

@ -0,0 +1,32 @@
local f = io.popen('. /lib/functions.sh; . /lib/ramips.sh; ramips_board_detect; echo "$RAMIPS_BOARD_NAME"; echo "$RAMIPS_MODEL"')
local board_name, model = f:read("*a"):match('([^\n]+)\n([^\n]+)')
f:close()
module 'platform_info'
-- The OpenWrt target
function get_target()
return 'ramips'
end
-- The OpenWrt subtarget or nil
function get_subtarget()
return 'rt305x'
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