Merge branch 'for-2015.x'
This commit is contained in:
commit
a1d8c7ea0f
|
@ -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
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue