Alpine kernel module support
Alpine Kernel Module Support (AKMS) is a tool that enables building out-of-tree (external) Linux kernel modules from source for each installed kernel on the user’s system in an automated and organized fashion. The concept is to have kernel modules automatically rebuilt when a new kernel version is installed.
AKMS is inspired by Dynamic Kernel Module Support (DKMS) used on many Linux distributions. It has been designed specifically for Alpine Linux and APK; implemented with simplicity, reliability, and security in mind.
Builds are always executed under an unprivileged user inside a sandbox (using Bubblewrap) with isolated Mount, IPC, PID, Network, UTS, Cgroup, and User (if possible) namespaces.
The built kernel objects are automatically compressed with the same compression format as other modules installed with the given kernel. The supported formats are: “gz”, “xz” (requires xz tool), and “zst” (requires zstd tool).
Another advantage of AKMS over DKMS is that you don’t need to have all the dependencies for building modules permanently installed on the system. If some dependencies are missing, they are automatically installed in a disposable overlay over your real root filesystem (using OverlayFS and bubblewrap). The original reason for using overlay was to avoid the limitation of the APK triggers — they are executed inside a “transaction” that holds an exclusive repository lock. This means that no packages could be installed if akms was executed by a trigger. Mounting a disposable overlay on top of “/” for building the modules overcomes this limitation and also provides other benefits.
Overview
AKMS has following actions with associated options and arguments.
install | Build and install module(s) into /lib/modules, unless already built (or -r is specified) or installed. |
build | Build module(s), unless already built (or -r is specified), without installing them. |
uninstall | Uninstall module(s) from /lib/modules. |
unbuild | Remove built module(s) version(s) from the state directory. |
status | Show status of modules. |
Example
- Broadcom Wi-Fi chipset wl AKMS Driver