From 6ddb1d3c0a208544345d3c9930d3e57381aeb640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20R=C3=BCttgers?= Date: Sat, 12 Sep 2015 16:21:10 +0200 Subject: [PATCH] Add support for x86-xen_domu target Keep subtargets near their targets --- libs/lua-platform-info/Makefile | 2 +- .../files/x86/xen_domu/platform_info.lua | 36 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 libs/lua-platform-info/files/x86/xen_domu/platform_info.lua diff --git a/libs/lua-platform-info/Makefile b/libs/lua-platform-info/Makefile index 1676a45..f0dd94c 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_x86_64||TARGET_ramips_rt305x||TARGET_brcm2708_bcm2708||TARGET_brcm2708_bcm2709||TARGET_sunxi) + DEPENDS:=+lua @(TARGET_ar71xx_generic||TARGET_ar71xx_nand||TARGET_mpc85xx_generic||TARGET_x86_generic||TARGET_x86_kvm_guest||TARGET_x86_64||TARGET_x86_xen_domu||TARGET_ramips_rt305x||TARGET_brcm2708_bcm2708||TARGET_brcm2708_bcm2709||TARGET_sunxi) endef define Package/lua-platform-info/description diff --git a/libs/lua-platform-info/files/x86/xen_domu/platform_info.lua b/libs/lua-platform-info/files/x86/xen_domu/platform_info.lua new file mode 100644 index 0000000..b47bafd --- /dev/null +++ b/libs/lua-platform-info/files/x86/xen_domu/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 'xen_domu' +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-xen' +end