diff --git a/README.md b/README.md index 057de9a..e868b67 100644 --- a/README.md +++ b/README.md @@ -57,4 +57,27 @@ cd 01_basic_module/ bear --append --output ../.vscode/compile_commands.json -- make -C $LINUX_MODULES_FOLDER/build M=$PWD modules ``` -Search -I args and -D args \ No newline at end of file +Search -I args and -D args + +### Sign kernel module for testing with secure boot enabled + +Prerequisites: Own secure boot keys + +Secure boot keys can be found in : + +- Fedora : `/etc/pki/akmods/certs/` +- With sbctl : `/var/lib/sbctl` + +``` +sign-file sha256 $SECUREBOOT_KEYS_PATH/private_key.priv $SECUREBOOT_KEYS_PATH/public_key.der .ko +``` + +sign-file is in `/usr/src/kernels/$(uname -r)/scripts` + +Full example (run as root): + +1. Fedora + +```bash +/usr/src/kernels/$(uname -r)/scripts/sign-file sha256 /etc/pki/akmods/private/private_key.priv /etc/pki/akmods/certs/public_key.der .ko +``` \ No newline at end of file