Add linux-tools, and add option to modprobe modules

This commit is contained in:
Oystein Tveit
2023-07-05 15:48:20 +02:00
parent 447cffe9ba
commit 5e392eef9e
2 changed files with 15 additions and 2 deletions

View File

@@ -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
}
}
}

View File

@@ -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