Browse Source

lua-platform-info: add support for brcm2708

Original patch by @MPW1412
pull/118/head
Matthias Schiffer 7 years ago
parent
commit
9d5b304e95
  1. 2
      libs/lua-platform-info/Makefile
  2. 37
      libs/lua-platform-info/files/brcm2708/bcm2708/platform_info.lua
  3. 37
      libs/lua-platform-info/files/brcm2708/bcm2709/platform_info.lua

2
libs/lua-platform-info/Makefile

@ -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

37
libs/lua-platform-info/files/brcm2708/bcm2708/platform_info.lua

@ -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

37
libs/lua-platform-info/files/brcm2708/bcm2709/platform_info.lua

@ -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
Loading…
Cancel
Save