summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathijs Rietbergen2025-12-27 10:04:52 +0000
committerHauke Mehrtens2026-03-29 15:29:13 +0000
commit6bd35b670d613475bf6d36a27ecb0b0d121a7350 (patch)
tree6e9d63fd9e911ff3b20dfd66c08dd4ff362d28ce
parentb2685cef6a33baf933b0936c586cbf04c3d60ca4 (diff)
downloadopenwrt-6bd35b670d613475bf6d36a27ecb0b0d121a7350.tar.gz
kernel: add kmods for vsockets over virtio
Add menuconfig options to include modules for (virtio) vsockets. These are used when running as Guest OS in a VM. OpenWRT can be run in a vm (mostly commonly on the x86/64 and armsr targets). Often it is convenient to have some sort of guest agent running, to ease communication from host to guest. Virtual Sockets provide this communication channel. Virtio is a transport for this communication channel. Virtual Sockets over virtio are for example used by Incus. Virtual Sockets in general are used by most hypervisors, including VMware, Hyper-V, and libvirt (qemu). These may need other transport-specific modules not included in this commit. Signed-off-by: Mathijs Rietbergen <mathijs.rietbergen@proton.me> Link: https://github.com/openwrt/openwrt/pull/21392 (cherry picked from commit c88e8a98167c82ce56ce184389b011637c204337) Link: https://github.com/openwrt/openwrt/pull/22602 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--package/kernel/linux/modules/virt.mk56
1 files changed, 56 insertions, 0 deletions
diff --git a/package/kernel/linux/modules/virt.mk b/package/kernel/linux/modules/virt.mk
index 9286ad489c..661aa1403c 100644
--- a/package/kernel/linux/modules/virt.mk
+++ b/package/kernel/linux/modules/virt.mk
@@ -139,3 +139,59 @@ define KernelPackage/vhost-net
endef
$(eval $(call KernelPackage,vhost-net))
+
+
+define KernelPackage/vsock
+ SUBMENU:=Virtualization
+ TITLE:=Virtual Socket Protocol
+ KCONFIG:= \
+ CONFIG_VSOCKETS \
+ CONFIG_VSOCKETS_LOOPBACK=n \
+ CONFIG_HYPERV_VSOCKETS=n
+ FILES:=$(LINUX_DIR)/net/vmw_vsock/vsock.ko
+ AUTOLOAD:=$(call AutoProbe,vsock)
+endef
+
+define KernelPackage/vsock/description
+ Kernel support support for the Virtual Socket Protocol.
+ Often used when running in a VM to communicate with the hypervisor.
+ Additionally needs a hypervisor-specific transport driver.
+endef
+
+$(eval $(call KernelPackage,vsock))
+
+
+define KernelPackage/vsock-virtio-common
+ SUBMENU:=Virtualization
+ TITLE:=Module used by other drivers to access Virtio Virtual Sockets
+ DEPENDS:=+kmod-vsock
+ KCONFIG:=CONFIG_VIRTIO_VSOCKETS_COMMON
+ FILES:=$(LINUX_DIR)/net/vmw_vsock/vmw_vsock_virtio_transport_common.ko
+ AUTOLOAD:=$(call AutoProbe,vmw_vsock_virtio_transport_common)
+ HIDDEN:=1
+endef
+
+$(eval $(call KernelPackage,vsock-virtio-common))
+
+
+define KernelPackage/vsock-virtio
+ SUBMENU:=Virtualization
+ TITLE:=Virtio transport driver for Virtual Sockets
+ DEPENDS:= @VIRTIO_SUPPORT +kmod-vsock +kmod-vsock-virtio-common
+ KCONFIG:=CONFIG_VIRTIO_VSOCKETS
+ FILES:=$(LINUX_DIR)/net/vmw_vsock/vmw_vsock_virtio_transport.ko
+ AUTOLOAD:=$(call AutoProbe,vmw_vsock_virtio_transport)
+endef
+
+define KernelPackage/vsock-virtio/description
+ Kernel support for Virtual Sockets over virtio.
+ Enable this transport if you plan to run OpenWRT in a virtual machine and the
+ hypervisor supports Virtual Sockets over virtio (Incus for example).
+
+ Usually needed by "guest agents" to function, as it provides a communication
+ channel between the guest os and the hypervisor.
+
+ The module will be called vmw_vsock_virtio_transport.
+endef
+
+$(eval $(call KernelPackage,vsock-virtio))