lua-platform-info: add support for brcm2708
Original patch by @MPW1412
This commit is contained in:
parent
b06388df9a
commit
9d5b304e95
|
@ -12,7 +12,7 @@ define Package/lua-platform-info
|
||||||
SECTION:=libs
|
SECTION:=libs
|
||||||
CATEGORY:=Libraries
|
CATEGORY:=Libraries
|
||||||
TITLE:=Lua hardware platform information library
|
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
|
endef
|
||||||
|
|
||||||
define Package/lua-platform-info/description
|
define Package/lua-platform-info/description
|
||||||
|
|
|
@ -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
|
|
@ -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…
Reference in New Issue