diff --git a/libs/lua-platform-info/Makefile b/libs/lua-platform-info/Makefile index 0d95047..0a54f4f 100644 --- a/libs/lua-platform-info/Makefile +++ b/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_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 define Package/lua-platform-info/description diff --git a/libs/lua-platform-info/files/x86/64/platform_info.lua b/libs/lua-platform-info/files/x86/64/platform_info.lua new file mode 100644 index 0000000..68e645e --- /dev/null +++ b/libs/lua-platform-info/files/x86/64/platform_info.lua @@ -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