This document describes how to build and integrate the wolfSSL Linux Kernel Module (LinuxKM) into standard Yocto images and initramfs images, including a complete example for NVIDIA Tegra-based systems.
Build the non-FIPS kernel module:
bitbake wolfssl-linuxkmThis produces:
libwolfssl.ko → /lib/modules/<kernel>/extra/
and installs an autoload entry:
/etc/modules-load.d/wolfssl.conf
This ensures wolfSSL loads automatically during systemd boot on standard rootfs images — even without an initramfs.
Some systems require wolfSSL to be available before the root filesystem is mounted. For that purpose, this layer provides:
classes/wolfssl-initramfs.bbclass
Unlike earlier versions, this class does not automatically install wolfssl-linuxkm or modify /init.
Instead, it provides a set of opt-in helper functions that the initramfs recipe can call explicitly.
In your initramfs recipe or .bbappend:
inherit wolfssl-initramfs
PACKAGE_INSTALL:append = " wolfssl-linuxkm"Automatic FIPS Selection:
If you have configured wolfssl-fips.conf with:
# Use wolfSSL FIPS Linux kernel module (FIPS-validated kernel module)
PREFERRED_PROVIDER_virtual/wolfssl-linuxkm = "wolfssl-linuxkm-fips"
PREFERRED_PROVIDER_wolfssl-linuxkm = "wolfssl-linuxkm-fips"Note: Both lines are required:
virtual/wolfssl-linuxkm- Controls build-time dependencieswolfssl-linuxkm- Controls runtime package installation
Then wolfssl-linuxkm will automatically resolve to the FIPS-validated version (wolfssl-linuxkm-fips).
No code changes needed - the virtual provider system handles the switch automatically.
Manual FIPS Selection (alternative):
You can also explicitly specify the FIPS version:
PACKAGE_INSTALL:append = " wolfssl-linuxkm-fips"This ensures the selected kernel module is included inside the initramfs filesystem.
If your initramfs uses modprobe, you should generate dependency metadata:
ROOTFS_POSTPROCESS_COMMAND += " wolfssl_initramfs_run_depmod; "The class exposes the following injection methods, letting you choose how /init gets modified:
| Function | Injection Point |
|---|---|
wolfssl_initramfs_inject_after_modalias |
After modalias scan loop |
wolfssl_initramfs_inject_after_loadmodules |
After the “Load and run modules” section |
wolfssl_initramfs_inject_after_kmsg |
Early injection after /dev/kmsg redirection |
Example (recommended for Tegra):
ROOTFS_POSTPROCESS_COMMAND += " wolfssl_initramfs_run_depmod; "
ROOTFS_POSTPROCESS_COMMAND += " wolfssl_initramfs_inject_after_modalias; "Fallback for simpler initramfs layouts:
ROOTFS_POSTPROCESS_COMMAND += " wolfssl_initramfs_inject_after_kmsg; "NVIDIA Tegra boards (Jetson Orin, Xavier, Nano, AGX, etc.) commonly use:
tegra-minimal-initramfs
To integrate wolfSSL LinuxKM into the Tegra initramfs, create this file:
meta-<project-name>-overrides/recipes-core/images/tegra-minimal-initramfs.bbappend
Contents:
inherit wolfssl-initramfs
PACKAGE_INSTALL:append = " wolfssl-linuxkm"
ROOTFS_POSTPROCESS_COMMAND += " wolfssl_initramfs_run_depmod; "
ROOTFS_POSTPROCESS_COMMAND += " wolfssl_initramfs_inject_after_modalias; "bitbake tegra-minimal-initramfsInside the generated rootfs you will find:
lib/modules/<kernel>/extra/libwolfssl.ko
etc/modules-load.d/wolfssl.conf
init (modified to auto-load wolfSSL)
wolfSSL now loads before the root filesystem is mounted — required for early-boot crypto or dependencies in Tegra BSPs.
- wolfssl-linuxkm is installed into the main rootfs
- systemd loads it automatically
- Suitable for most Linux systems
-
libwolfssl.ko included inside initramfs
-
modprobe libwolfsslruns before mount of rootfs -
Required if:
- Early boot crypto operations need wolfSSL
- Kernel services in initramfs depend on wolfSSL
- Tegra BSP loads cryptography-related modules early
- FIPS-certified environments require early module availability
Tegra platforms (especially industrial/robotics/ADAS) rely heavily on initramfs-stage drivers and may need wolfSSL before userspace starts. Placing wolfSSL in initramfs avoids failures due to:
- module load ordering
- missing crypto backends
- delayed rootfs mounts
| Use Case | Recommended Method |
|---|---|
| Normal Linux systems | Include wolfssl-linuxkm in IMAGE_INSTALL |
| Early-boot crypto or initramfs crypto services | Use wolfssl-initramfs helpers |
| Tegra or meta-tegra BSP | Add inherit wolfssl-initramfs and explicit postprocess commands |
wolfssl-initramfs.bbclass now acts as a modular, opt-in integration toolkit, supporting both standard and FIPS kernel modules cleanly.