Load additional kernel drivers#

From within a SimpleSwitch™ package you are allowed to load additional kernel modules (.ko files). Please make sure that they are matching the kernel running on the base image.

Best practice#

It is advised to unload drivers if the SimpleSwitch™ package is stopped. Use the template shell script below as a starting point for your application.

set -o errexit

EXTRA_DRIVERS="" # list the kernel module names to be loaded/unloaded by the container

trap_exit() {
if [ -n "${EXTRA_DRIVERS}" ]; then
    modprobe -r ${EXTRA_DRIVERS} || true
fi
}
trap trap_exit EXIT INT TERM

if [ -n "${EXTRA_DRIVERS}" ]; then
    modprobe ${EXTRA_DRIVERS}
fi

# Run your application
...