lua-platform-info: add support for x86-64 target
This commit is contained in:
parent
1faf424b35
commit
b06388df9a
|
@ -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_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)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Package/lua-platform-info/description
|
define Package/lua-platform-info/description
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
local model
|
||||||
|
|
||||||
|
for line in io.lines('/proc/cpuinfo') do
|
||||||
|
model = line:match('^model name%s*:%s*(.+)$')
|
||||||
|
if model then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
module 'platform_info'
|
||||||
|
|
||||||
|
-- The OpenWrt target
|
||||||
|
function get_target()
|
||||||
|
return 'x86'
|
||||||
|
end
|
||||||
|
|
||||||
|
-- The OpenWrt subtarget or nil
|
||||||
|
function get_subtarget()
|
||||||
|
return '64'
|
||||||
|
end
|
||||||
|
|
||||||
|
-- The board name
|
||||||
|
function get_board_name()
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- The model name
|
||||||
|
function get_model()
|
||||||
|
return model
|
||||||
|
end
|
||||||
|
|
||||||
|
-- The image name for sysupgrades
|
||||||
|
function get_image_name()
|
||||||
|
return 'x86-64'
|
||||||
|
end
|
Loading…
Reference in New Issue