This provides an instruction and utilities for signing DKMS kernel modules for UEFI secure boot. This instruction is mainly for Fedora and RHEL, modify this to suit your environment.
So far, following modules are provided:
- evdi (Displaylink)
This section is derived from Signing Kernel Modules for Secure Boot
Steps in this section only need to be run once. Skip this part if your signing keys are enrolled in the system.
git clone https://github.com/definite/dkms-modules
cd dkms-modules
Firstly edit openssl.cnf
and change the CHANGEME
.
Then run:
openssl req -x509 -new -nodes -utf8 -sha256 -days 36500 -batch \
-config openssl.cnf -outform DER \
-out MOK.der -keyout MOK.priv
Move the keys to a secure directory. Assume it to be /root
.
A Machine owner key (MOK) is a machine-owner-generated key to sign EFI binaries, such as kernel modules.
Previous section we have MOK.der
the public key and MOK.priv
the private key.
- Enroll the
MOK.der
for to UEFI with:Remember the password, you need it in step 3.sudo mokutil --import /root/MOK.der
- Reboot
- Pending MOK key enrollment invokes MokManager in UEFI console. You will need to enter password from step 1 to finish enrolling.
The command dkms is most likely to be run as root, so assuming $HOME
is /root
:
Edit /root/.config/dkms-sign.conf
with content like:
KEY_DIR=AbsoluteDirThatContainsBothMOKKeys
This section is only required when install the first time or module new version. We use the evdi module as example.
Download and extract the source to /usr/src
For example, evdi-1.6.0 should be extracted as /usr/src/evdi-1.6.0
dkms.conf
specify how to build dkms module.
Use the evdi-dkms.conf
as template and save to the module source directory as dkms.conf
For example, for evdi-1.6.0, the modified dkms.conf
should be saved as /usr/src/evdi-1.6.0/dkms.conf
sign_module.sh
is a bash script to help signing modules.
This file should be copied to the module source directory as sign_module.sh
.
sign_module.sh
need to be executable. Ensure it by:
chmod 755 sign_module.sh
dkms command should be working by now.
For example, to build,sign and install evdi-1.6.0 for current kernel:
sudo dkms install evdi/1.6.0 -k $(uname -r)
And to remove evdi/1.6.0 for current kernel:
sudo dkms remove evdi/1.6.0 -k $(uname -r)
Enjoy!