Skip to content

Latest commit

 

History

History
43 lines (41 loc) · 1.53 KB

File metadata and controls

43 lines (41 loc) · 1.53 KB
  1. 创建 X.509 公私钥对
# cat << EOF > configuration_file.config
[ req ]
default_bits = 4096
distinguished_name = req_distinguished_name
prompt = no
string_mask = utf8only
x509_extensions = myexts

[ req_distinguished_name ]
O = Organization
CN = Organization signing key
emailAddress = E-mail address

[ myexts ]
basicConstraints=critical,CA:FALSE
keyUsage=digitalSignature
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid
EOF
# openssl req -x509 -new -nodes -utf8 -sha256 -days 36500 \
-batch -config configuration_file.config -outform DER \
-out my_signing_key_pub.der \
-keyout my_signing_key.priv
  1. 注册公钥至 MOK 列表
# mokutil --import my_signing_key_pub.der
  • 注册完后重启,在 UEFI 界面确认添加
  1. sign-file对 ko 文件签名 sign-file 属于内核提供的 utility,可使用 dpkg -S sign-file 搜素它的路径
# /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 my_signing_key.priv my_signing_key_pub.der my_module.ko
  1. 安装该驱动 insmod my_module.ko
  2. 三种验证安装成功方法方法
  • 使用 lsmod:lsmod | grep my_module.ko
  • 使用 dmesg(printk 的内容会显示至此):dmesg
  • 查看 /var/log/syslog