mirror of
https://github.com/h7x4/usbip-dkms-devcontainer-feature.git
synced 2025-12-14 23:13:12 +01:00
Move modprobes into post-start script
There's an issue with running modprobe during buildtime. Not only is it semantically not valid, you don't have capabilities activated and seccomp disabled during build time, so running modprobe will crash the entire build.
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
"capAdd": [ "SYS_MODULE" ],
|
||||
"securityOpt": [ "seccomp=unconfined" ],
|
||||
|
||||
"postStartCommand": "/opt/usbip-dkms/post-start.sh",
|
||||
|
||||
"options": {
|
||||
"kernelVersion": {
|
||||
"description": "Kernel version to use for the source code of the USBIP modules. If not specified, the feature will try to determine the kernel version automatically, but this is not guaranteed to work.",
|
||||
|
||||
@@ -48,11 +48,18 @@ fi
|
||||
|
||||
dkms install -m usbip -v "${KERNEL_VERSION}"
|
||||
|
||||
mkdir -p /opt/usbip-dkms
|
||||
|
||||
echo "#!/usr/bin/env bash" > /opt/usbip-dkms/post-start.sh
|
||||
chmod +x /opt/usbip-dkms/post-start.sh
|
||||
|
||||
if [ "$AUTO_MODPROBE" != "false" ]; then
|
||||
modprobe usbip-core
|
||||
modprobe usbip-host
|
||||
modprobe vhci-hcd
|
||||
{
|
||||
echo "modprobe usbip-core"
|
||||
echo "modprobe usbip-host"
|
||||
echo "modprobe vhci-hcd"
|
||||
} >> /opt/usbip-dkms/post-start.sh
|
||||
if [ "$ENABLE_VUDC" != "false" ]; then
|
||||
modprobe usbip-vudc
|
||||
echo "modprobe usbip-vudc" >> /opt/usbip-dkms/post-start.sh
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user