package modprobe

import "github.com/dotcloud/docker/internal/modprobe"

Package modprobe attempts to load kernel modules. It may have more success than simply running "modprobe", particularly for docker-in-docker.

Index

Functions

func LoadModules

func LoadModules(ctx context.Context, isLoaded func() error, modNames ...string) error

LoadModules attempts to load kernel modules, if necessary.

isLoaded must be a function that checks whether the modules are loaded. It may be called multiple times. isLoaded must return an error to indicate that the modules still need to be loaded, otherwise nil.

For each method of loading modules, LoadModules will attempt the load for each of modNames, then it will call isLoaded to check the result - moving on to try the next method if needed, and there is one.

The returned error is the result of the final call to isLoaded.

Source Files

modprobe_linux.go

Version
v28.0.0-rc.1+incompatible
Published
Feb 6, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
1 second ago

Tools for package owners.