lua-platform-info: add support for brcm2708

Original patch by @MPW1412
This commit is contained in:
Matthias Schiffer 2015-07-10 18:22:17 +02:00
parent b06388df9a
commit 9d5b304e95
3 changed files with 75 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_ar71xx_nand||TARGET_mpc85xx_generic||TARGET_x86_generic||TARGET_x86_kvm_guest||TARGET_x86_64||TARGET_ramips_rt305x)
DEPENDS:=+lua @(TARGET_ar71xx_generic||TARGET_ar71xx_nand||TARGET_mpc85xx_generic||TARGET_x86_generic||TARGET_x86_kvm_guest||TARGET_x86_64||TARGET_ramips_rt305x||TARGET_brcm2708_bcm2708||TARGET_brcm2708_bcm2709)
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 'brcm2708'
end
-- The OpenWrt subtarget or nil
function get_subtarget()
return 'bcm2708'
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 nil
end

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 'brcm2708'
end
-- The OpenWrt subtarget or nil
function get_subtarget()
return 'bcm2709'
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 nil
end