From 5e392eef9eca7086fadc7feb99ef54d816824082 Mon Sep 17 00:00:00 2001 From: Oystein Tveit Date: Wed, 5 Jul 2023 15:48:20 +0200 Subject: [PATCH] Add `linux-tools`, and add option to modprobe modules --- features/usbip-dkms/devcontainer-feature.json | 7 ++++++- features/usbip-dkms/install.sh | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/features/usbip-dkms/devcontainer-feature.json b/features/usbip-dkms/devcontainer-feature.json index fd975e6..537ce78 100644 --- a/features/usbip-dkms/devcontainer-feature.json +++ b/features/usbip-dkms/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "USBIP DKMS Module", "id": "usbip-dkms", - "version": "0.2.3", + "version": "0.3.0", "description": "DKMS module for USBIP", "installsAfter": [ @@ -28,6 +28,11 @@ "description": "Enable Virtual USB Device Controller (VUDC) support. This requires the kernel to have CONFIG_USB_GADGET enabled, which linux-azure (GitHub Codespaces) does not have.", "type": "boolean", "default": false + }, + "autoModprobe": { + "description": "Automatically modprobe all modules after installation.", + "type": "boolean", + "default": true } } } diff --git a/features/usbip-dkms/install.sh b/features/usbip-dkms/install.sh index 06b0e03..3b314dc 100644 --- a/features/usbip-dkms/install.sh +++ b/features/usbip-dkms/install.sh @@ -2,6 +2,7 @@ KERNEL_VERSION="${KERNELVERSION:-}" ENABLE_VUDC="${ENABLEVUDC:-false}" +AUTO_MODPROBE="${AUTOMODPROBE:-true}" set -euo @@ -18,9 +19,10 @@ apt-get install -y --no-install-recommends \ dkms \ git \ "linux-headers-$(uname -r)" \ + "linux-tools-$(uname -r)" \ subversion -# Trick to be able to only download the usbip folder +# This is a trick to download only the usbip directory, and not the entire project. svn export "https://github.com/torvalds/linux/tags/${KERNEL_VERSION}/drivers/usb/usbip" "/usr/src/usbip-${KERNEL_VERSION}" install -m644 dkms.conf "/usr/src/usbip-${KERNEL_VERSION}/dkms.conf" @@ -45,3 +47,9 @@ if ! dkms build -m usbip -v "${KERNEL_VERSION}"; then fi dkms install -m usbip -v "${KERNEL_VERSION}" + +if [ "$AUTO_MODPROBE" != "false" ]; then + modprobe usbip-core + modprobe usbip-host + modprobe vhci-hcd +fi \ No newline at end of file