-
-
Save jeremyvisser/039f1f3b2471818deb91edd9540aeebb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install to /usr/local/bin/dkms-sign-module (mode 0744) | |
# Create /etc/dkms/<module>.conf with contents: | |
# POST_BUILD=../../../../../../usr/local/bin/dkms-sign-module | |
set -x | |
do_sign() { | |
/lib/modules/$kernelver/build/scripts/sign-file sha256 /etc/kernel/mok/mok.{key,der} "$1" | |
} | |
for module in ../$kernelver/$arch/module/*.ko*; do | |
echo "Signing module: $module" | |
module_basename=${module:0:-3} | |
module_suffix=${module: -3} | |
if [[ "$module_suffix" == ".xz" ]]; then | |
unxz $module | |
do_sign $module_basename | |
xz -f $module_basename | |
elif [[ "$module_suffix" == ".gz" ]]; then | |
gunzip $module | |
do_sign $module_basename | |
gzip -9f $module_basename | |
else | |
do_sign $module | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment