kmod

package
v0.0.0-...-677ed08 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2016 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package kmod implements a backend which loads kernel modules on behalf of interfaces.

Interfaces may request kernel modules to be loaded by providing snippets via their respective "*Snippet" methods for interfaces.SecurityKMod security system. The snippet should contain a newline-separated list of requested kernel modules. The KMod backend stores all the modules needed by given snap in /etc/modules-load.d/snap.<snapname>.conf file ensuring they are loaded when the system boots and also loads these modules via modprobe. If a snap is uninstalled or respective interface gets disconnected, the corresponding /etc/modules-load.d/ config file gets removed, however no kernel modules are unloaded. This is by design.

Note: this mechanism should not be confused with kernel-module-interface; kmod only loads a well-defined list of modules provided by interface definition and doesn't grant any special permissions related to kernel modules to snaps, in contrast to kernel-module-interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadModule

func LoadModule(module string) error

Types

type Backend

type Backend struct{}

Backend is responsible for maintaining kernel modules

func (*Backend) Name

func (b *Backend) Name() string

Name returns the name of the backend.

func (*Backend) Remove

func (b *Backend) Remove(snapName string) error

Remove removes modules config file specific to a given snap.

This method should be called after removing a snap.

If the method fails it should be re-tried (with a sensible strategy) by the caller.

func (*Backend) Setup

func (b *Backend) Setup(snapInfo *snap.Info, devMode bool, repo *interfaces.Repository) error

Setup creates a conf file with list of kernel modules required by given snap, writes it in /etc/modules-load.d/ directory and immediately loads the modules using /sbin/modprobe. The devMode is ignored.

If the method fails it should be re-tried (with a sensible strategy) by the caller.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL