Skip to content

Instantly share code, notes, and snippets.

@duckyduckG
Last active July 2, 2025 09:01
Show Gist options
  • Select an option

  • Save duckyduckG/cc6742406d10f5a65fd70ab84e151c1f to your computer and use it in GitHub Desktop.

Select an option

Save duckyduckG/cc6742406d10f5a65fd70ab84e151c1f to your computer and use it in GitHub Desktop.
How to sign Modules manually after compiling kernel

One needs to sign modules manually otherwise they do not load:

error

$ insmod: failed to load /vendor/lib/modules/wlan.ko: Required key not available

we need to sign these modules

Requirement

$ Compiled sign-file
$ modules version should be same as kernel, if you recompile kernel with clean new keys, you need to sign it again.

Compile sign-file

$ gcc -Wall -O2 -o scripts/sign-file scripts/sign-file.c -lcrypto

Sign it - example of QCA 3.0 wifi driver Module

$ scripts/sign-file sha256 out/certs/signing_key.pem out/certs/signing_key.x509 out/drivers/staging/qcacld-3.0/wlan.ko

Now adb push it to internal storage or /data/local/tmp

and load it

$ insmod /vendor/lib/modules/wlan.ko or path to module/name.ko

Now check if it works or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment