Skip to content
Open
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
10 changes: 10 additions & 0 deletions dkms.in
Original file line number Diff line number Diff line change
Expand Up @@ -1280,10 +1280,20 @@ prepare_mok()
fi

if [[ ! $mok_signing_key && -f ${kernel_config} ]]; then
# Switch to the kernel's source directory while resolving
# the module signing key, since the path set within the config
# could be relative to the source directory
local _pwd=$(pwd)
cd $kernel_source_dir

mok_signing_key=$(grep "^CONFIG_MODULE_SIG_KEY=" "${kernel_config}" | cut -f2 -d= | sed 's/"//g')
# Assume the absolute path to the certificate
mok_signing_key=$(readlink -f "${mok_signing_key}")
# Kernel module signing facility requires PEM files containing both
# the key and the certificate, so in this case both will be the same.
mok_certificate=${mok_signing_key}

cd $_pwd
fi
;;
esac
Expand Down