Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,3 +306,27 @@ exported with exactly 44 characters of base64. WolfGuard public keys are
roughly twice that length, unless built with `WG_USE_PUBLIC_KEY_COMPRESSION`,
which is not currently supported in FIPS v5, but is supported in FIPS v6 and
later.


### Using DKMS for automatic kernel module rebuilds

DKMS (Dynamic Kernel Module Support) automatically rebuilds `wolfguard.ko`
whenever a new kernel is installed, which is useful on systems with frequent
kernel updates (e.g. Ubuntu with `unattended-upgrades`).

Before registering wolfguard with DKMS, the built wolfssl source tree must be
accessible at `/usr/src/wolfssl`. Create a symlink if your wolfssl tree is
elsewhere:
```
# ln -s /path/to/your/wolfssl /usr/src/wolfssl
```
If you prefer not to use `/usr/src/wolfssl`, set `WOLFSSL_ROOT` in the
environment before running `dkms install` and it will be passed through to the
build.

Register and install the module (replace `<version>` with the value of
`PACKAGE_VERSION` in `kernel-src/dkms.conf`):
```
# dkms add /path/to/wolfguard/kernel-src
# dkms install wolfguard/<version>
```
6 changes: 3 additions & 3 deletions kernel-src/dkms.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ AUTOINSTALL=yes
BUILT_MODULE_NAME="wolfguard"
DEST_MODULE_LOCATION="/wolfssl"

MAKE="make -j module"
MAKE="make -j WOLFSSL_ROOT=${WOLFSSL_ROOT:-/usr/src/wolfssl} module"
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WOLFSSL_ROOT is injected without quoting, so paths containing spaces (or shell-sensitive characters) will break DKMS builds. Quote the assignment so the value is passed as a single make variable (e.g., WOLFSSL_ROOT="...") while keeping the default fallback behavior.

Suggested change
MAKE="make -j WOLFSSL_ROOT=${WOLFSSL_ROOT:-/usr/src/wolfssl} module"
MAKE="make -j WOLFSSL_ROOT=\"${WOLFSSL_ROOT:-/usr/src/wolfssl}\" module"

Copilot uses AI. Check for mistakes.

# requires kernel 3.10 - 7.x, inclusive:
BUILD_EXCLUSIVE_KERNEL="^(([7654]\.)|(3\.1[0-9]))"
# requires kernel 3.10 - 8.x, inclusive:
BUILD_EXCLUSIVE_KERNEL="^(([87654]\.)|(3\.1[0-9]))"
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex is inconsistent: the major-version branch includes a \. but the 3\.1[0-9] branch does not. Adding a trailing \. to the 3.10–3.19 branch (e.g., 3\.1[0-9]\.) makes the intent clearer and avoids accidental matches on longer prefixes.

Suggested change
BUILD_EXCLUSIVE_KERNEL="^(([87654]\.)|(3\.1[0-9]))"
BUILD_EXCLUSIVE_KERNEL="^(([87654]\.)|(3\.1[0-9]\.))"

Copilot uses AI. Check for mistakes.