[OpenWrt-Devel] Hyper-V Support for X86 in Barrier Breaker

Ning Ye ning at oaklight.us
Wed Aug 6 12:07:24 EDT 2014


My previous patch added Hyper-V device drivers to trunk branch at
http://patchwork.openwrt.org/patch/6003/.  This patch is to back port it to
Barrier Breaker 14.07 branch.  The difference is the absence of x86_64
target.

 

Signed-off-by: Ning Ye <ning at oaklight.us <mailto:ning at oaklight.us> > 

 

 

diff --git a/config/Config-images.in b/config/Config-images.in

old mode 100644

new mode 100755

index 39e51e4..7020f84

--- a/config/Config-images.in

+++ b/config/Config-images.in

@@ -239,6 +239,16 @@ menu "Target Images"

                               select TARGET_IMAGES_PAD

                               select PACKAGE_kmod-e1000

+             config VHD_IMAGES

+                             bool "Build Hyper-V image files (VHD)"

+                             depends on TARGET_x86 || TARGET_x86_64

+                             select GRUB_IMAGES

+                             select TARGET_IMAGES_PAD

+                             select PACKAGE_kmod-hyperv-balloon

+                             select PACKAGE_kmod-hyperv-net-vsc

+                             select PACKAGE_kmod-hyperv-util

+                             select PACKAGE_kmod-hyperv-storage

+

               config TARGET_IMAGES_PAD

                               bool "Pad images to filesystem size (for
JFFS2)"

                               depends on OLPC_BOOTSCRIPT_IMAGES ||
GRUB_IMAGES

diff --git a/package/kernel/linux/modules/virtual.mk
b/package/kernel/linux/modules/virtual.mk

old mode 100644

new mode 100755

index 190d844..a67d71c

--- a/package/kernel/linux/modules/virtual.mk

+++ b/package/kernel/linux/modules/virtual.mk

@@ -186,3 +186,85 @@ define KernelPackage/xen-pcidev/description

endef

 $(eval $(call KernelPackage,xen-pcidev))

+

+#

+# Hyper-V Drives depends on x86 or x86_64.

+#

+define KernelPackage/hyperv-balloon

+  SUBMENU:=$(VIRTUAL_MENU)

+  DEPENDS:=@(TARGET_x86||TARGET_x86_64)

+  TITLE:=Microsoft Hyper-V Balloon Driver

+  KCONFIG:= \

+    CONFIG_HYPERV_BALLOON \

+    CONFIG_HYPERVISOR_GUEST=y \

+    CONFIG_PARAVIRT=n \

+    CONFIG_HYPERV=y

+  FILES:=$(LINUX_DIR)/drivers/hv/hv_balloon.ko

+  AUTOLOAD:=$(call AutoLoad,06,hv_balloon)

+endef

+

+define KernelPackage/hyperv-balloon/description

+  Microsofot Hyper-V balloon driver.

+endef

+

+$(eval $(call KernelPackage,hyperv-balloon))

+

+define KernelPackage/hyperv-net-vsc

+  SUBMENU:=$(VIRTUAL_MENU)

+  DEPENDS:=@(TARGET_x86||TARGET_x86_64)

+  TITLE:=Microsoft Hyper-V Network Driver

+  KCONFIG:= \

+    CONFIG_HYPERV_NET \

+    CONFIG_HYPERVISOR_GUEST=y \

+    CONFIG_PARAVIRT=n \

+    CONFIG_HYPERV=y

+  FILES:=$(LINUX_DIR)/drivers/net/hyperv/hv_netvsc.ko

+  AUTOLOAD:=$(call AutoLoad,35,hv_netvsc)

+endef

+

+define KernelPackage/hyperv-net-vsc/description

+  Microsoft Hyper-V Network Driver

+endef

+

+$(eval $(call KernelPackage,hyperv-net-vsc))

+

+define KernelPackage/hyperv-util

+  SUBMENU:=$(VIRTUAL_MENU)

+  DEPENDS:=@(TARGET_x86||TARGET_x86_64)

+  TITLE:=Microsoft Hyper-V Utility Driver

+  KCONFIG:= \

+    CONFIG_HYPERV_UTILS \

+    CONFIG_HYPERVISOR_GUEST=y \

+    CONFIG_PARAVIRT=n \

+    CONFIG_HYPERV=y

+  FILES:=$(LINUX_DIR)/drivers/hv/hv_util.ko

+  AUTOLOAD:=$(call AutoLoad,10,hv_util)

+endef

+

+define KernelPackage/hyperv-util/description

+  Microsoft Hyper-V Utility Driver

+endef

+

+$(eval $(call KernelPackage,hyperv-util))

+

+#

+# Hyper-V Storage Drive needs to be in kernel rather than module to load
the root fs.

+#

+define KernelPackage/hyperv-storage

+  SUBMENU:=$(VIRTUAL_MENU)

+  DEPENDS:=@(TARGET_x86||TARGET_x86_64) +kmod-scsi-core

+  TITLE:=Microsoft Hyper-V Storage Driver

+  KCONFIG:= \

+    CONFIG_HYPERV_STORAGE=y \

+    CONFIG_HYPERVISOR_GUEST=y \

+    CONFIG_PARAVIRT=n \

+    CONFIG_HYPERV=y

+  FILES:=$(LINUX_DIR)/drivers/scsi/hv_storvsc.ko

+  AUTOLOAD:=$(call AutoLoad,40,hv_storvsc)

+endef

+

+define KernelPackage/hyperv-storage/description

+  Microsoft Hyper-V Storage Driver

+endef

+

+$(eval $(call KernelPackage,hyperv-storage))

diff --git a/target/linux/x86/config-3.10 b/target/linux/x86/config-3.10

old mode 100644

new mode 100755

index 69f2f08..3fa6344

--- a/target/linux/x86/config-3.10

+++ b/target/linux/x86/config-3.10

@@ -193,6 +193,14 @@ CONFIG_HW_RANDOM=y

CONFIG_HW_RANDOM_GEODE=y

CONFIG_HW_RANDOM_VIA=y

# CONFIG_HYPERVISOR_GUEST is not set

+# CONFIG_HYPERV is not set

+# CONFIG_HYPERV_BALLOON is not set

+# CONFIG_HYPERV_NET is not set

+# CONFIG_HYPERV_STORAGE is not set

+# CONFIG_HYPERV_UTILS is not set

+# CONFIG_FB_HYPERV is not set

+# CONFIG_HID_HYPERV_MOUSE is not set

+# CONFIG_VMWARE_BALLOON is not set

CONFIG_HZ_PERIODIC=y

CONFIG_I8253_LOCK=y

# CONFIG_I8K is not set

diff --git a/target/linux/x86/image/Makefile
b/target/linux/x86/image/Makefile

old mode 100644

new mode 100755

index 5983718..80ef5cf

--- a/target/linux/x86/image/Makefile

+++ b/target/linux/x86/image/Makefile

@@ -178,6 +178,15 @@ ifneq ($(CONFIG_VMDK_IMAGES),)

   endef

endif

+ifneq ($(CONFIG_VHD_IMAGES),)

+  define Image/Build/vhd

+             rm $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vhd || true

+             qemu-img convert -f raw -O vpc \

+                             $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img \

+                             $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vhd

+  endef

+endif

+

define Image/Build/gzip

               gzip -f9 $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img

               gzip -f9 $(BIN_DIR)/$(IMG_PREFIX)-rootfs-$(1).img

@@ -252,6 +261,7 @@ define Image/Build

               $(call Image/Build/grub2,$(1))

               $(call Image/Build/vdi,$(1))

               $(call Image/Build/vmdk,$(1))

+             $(call Image/Build/vhd,$(1))

               $(CP) $(KDIR)/root.$(1)
$(BIN_DIR)/$(IMG_PREFIX)-rootfs-$(1).img

   else

               $(CP) $(KDIR)/root.iso $(BIN_DIR)/$(IMG_PREFIX).iso

               

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20140806/20f96525/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list