[Spice-devel] [PATCH usbredir 8/8] Create a sysconfig modules script, and install it.

Jeremy White jwhite at codeweavers.com
Wed Dec 9 14:16:08 PST 2015


Signed-off-by: Jeremy White <jwhite at codeweavers.com>
---
 kernel/Makefile         | 11 +++++++----
 kernel/usbredir.modules | 30 ++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 4 deletions(-)
 create mode 100644 kernel/usbredir.modules

diff --git a/kernel/Makefile b/kernel/Makefile
index dd67ac2..481dc9b 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -1,7 +1,8 @@
 includes := -I$(PWD)/../usbredirparser/
 
 MODULE_VERSION ?= $(shell uname -r)
-install_target := $(DESTDIR)/lib/modules/$(MODULE_VERSION)/kernel/drivers/usb/misc/
+modules_target := $(DESTDIR)/lib/modules/$(MODULE_VERSION)/kernel/drivers/usb/misc/
+sysconfig_target := $(DESTDIR)/etc/sysconfig/modules/
 
 INSTALL_PROGRAM ?= install
 
@@ -14,8 +15,10 @@ usbredir.ko:
 clean:
 	make ccflags-y="${includes}" -C /lib/modules/$(MODULE_VERSION)/build/ M=$(PWD) clean
 
-install: usbredir.ko
-	mkdir -p $(install_target)
-	$(INSTALL_PROGRAM) usbredir.ko $(install_target)
+install: usbredir.ko usbredir.modules
+	mkdir -p $(modules_target)
+	$(INSTALL_PROGRAM) usbredir.ko $(modules_target)
+	mkdir -p $(sysconfig_target)
+	$(INSTALL_PROGRAM) usbredir.modules $(sysconfig_target)
 
 all: usbredir.ko
diff --git a/kernel/usbredir.modules b/kernel/usbredir.modules
new file mode 100644
index 0000000..bf2eceb
--- /dev/null
+++ b/kernel/usbredir.modules
@@ -0,0 +1,30 @@
+#!/bin/bash
+#
+#   usbredir.module
+#       Load the XSpice USB redirection kernel module.
+#
+
+# Set ENABLED to 1 to load this module at boot.
+ENABLED=0
+
+# Uncomment and set these to set module parameters as desired
+
+# List of USB Vendor and Device IDs permitted to connect
+#WHITELIST="VVVV:DDDD;VVVV:DDDD"
+
+# List of USB Vendor and Device IDs not allowed
+#BLACKLIST="VVVV:DDDD;VVVV:DDDD"
+
+# Maximum virtual hubs to create
+#MAX_HUBS=64
+
+# Maximum virtual devices per virtual hub to create
+#DEVICES_PER_HUB=16
+
+if [ $ENABLED -gt 0 ] ; then
+    [ -z "$WHITELIST" ]       || whitelist="whitelist=$WHITELIST"
+    [ -z "$BLACKLIST" ]       || blacklist="blacklist=$BLACKLIST"
+    [ -z "$MAX_HUBS" ]        || max_hubs="max_hubs=$MAX_HUBS"
+    [ -z "$DEVICES_PER_HUB" ] || devices_per_hub="devices_per_hub=$DEVICES_PER_HUB"
+    exec modprobe usbredir "$whitelist" "$blacklist" "$max_hubs" "$devices_per_hub" >/dev/null 2>&1
+fi
-- 
2.1.4



More information about the Spice-devel mailing list