diff --git a/dkms.in b/dkms.in index bca479d7..a840e7d1 100644 --- a/dkms.in +++ b/dkms.in @@ -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