1. 程式人生 > >解決insmod error required key not available

解決insmod error required key not available

由於目前bios支援efi,如果支援UEFI Secure Boot啟動,那麼核心所有模組都必須使用UEFI Secure key 簽名.

檢視當前系統key:

#keyctl list %:.system_keyring

如果系統沒有開啟UEFI Secure Boot,會類似如下輸出:

3 keys in keyring:
...asymmetric: Red Hat Enterprise Linux Driver Update Program (key 3): bf57f3e87...
...asymmetric: Red Hat Enterprise Linux kernel signing key: 4249689eefc77e95880b...
...asymmetric: Red Hat Enterprise Linux kpatch signing key: 4d38fd864ebe18c5f0b7...
否則,類似輸出:
6 keys in keyring:
...asymmetric: Red Hat Enterprise Linux Driver Update Program (key 3): bf57f3e87...
...asymmetric: Red Hat Secure Boot (CA key 1): 4016841644ce3a810408050766e8f8a29...
...asymmetric: Microsoft Corporation UEFI CA 2011: 13adbf4309bd82709c8cd54f316ed...
...asymmetric: Microsoft Windows Production PCA 2011: a92902398e16c49778cd90f99e...
...asymmetric: Red Hat Enterprise Linux kernel signing key: 4249689eefc77e95880b...
...asymmetric: Red Hat Enterprise Linux kpatch signing key: 4d38fd864ebe18c5f0b7...
你也可以檢視核心與UEFI Secure Boot(如UEFI Secure Boot db, embedded shim, 以及 MOK list)相關的驗證祕鑰:
dmesg | grep 'EFI: Loaded cert'
[5.160660] EFI: Loaded cert 'Microsoft Windows Production PCA 2011: a9290239...
[5.160674] EFI: Loaded cert 'Microsoft Corporation UEFI CA 2011: 13adbf4309b...
[5.165794] EFI: Loaded cert 'Red Hat Secure Boot (CA key 1): 4016841644ce3a8...
當然,如果你的bios支援關閉UEFI Secure Boot,你可以在bios的boot項中關閉UEFI Secure Boot.

否則只能為自己製作一個.

相關工具情況:

命令 軟體包 適用 功能
openssl openssl Build system 生成X509公私祕鑰對
sign-file kernel-devel Build system 對核心模組使用X509公私祕鑰對簽名
perl perl Build system 簽名指令碼
mokutil mokutil Target system 手動註冊公鑰到系統
keyctl keyutils Target system 手動取消註冊公鑰到系統
生成x509公私祕鑰例項指令碼:

1. 生成配置檔案:

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
2. 生成祕鑰(一般把公私鑰放在/usr/src/kernels/`uname -r`資料夾):
]# openssl req -x509 -new -nodes -utf8 -sha256 -days 36500 -batch -config configuration_file.config -outform DER -out public_key.der -keyout private_key.priv
3. 在目標系統註冊方法:

1. 把生成的UEFI Secure Boot key資料植入到出廠映象檔案即bios中(基本不可能)

2. 把生成的UEFI Secure Boot key資料植入到efi映象檔案(不知道弄,如果哪位大俠知道,求告知)

3. 把公鑰新增到 MOK lis,執行以下步驟:

mokutil --import public_key.der
然後重啟電腦,重啟後會有一個驗證密碼的過程.

使用私鑰註冊模組:

直接編譯

make -C /usr/src/kernels/$(uname -r) M=$PWD modules
或者,編譯好後加入到模組

cd /usr/src/kernels/`uname -r` && perl ./scripts/sign-file sha256 private_key.priv public_key.der $(mod_dir)/mod.ko

相關推薦

解決insmod error required key not available

由於目前bios支援efi,如果支援UEFI Secure Boot啟動,那麼核心所有模組都必須使用UEFI Secure key 簽名. 檢視當前系統key: #keyctl list %:.system_keyring 如果系統沒有開啟UEFI Secure Boot,

ubuntu 18.04 virtualbox 5.02 could not insert 'vboxdrv': Required key not available 問題解決方法

核心版本變更,開啟了Secure Boot的電腦上模組必須註冊才允許執行,解決問題的辦法就是註冊這些模組。 一、找到MOK.priv地址並進入 locate MOK.priv 二、建立簽名 openssl req -new -x509 -newkey rsa:2

Required key not available 的原因和處理

我們在日常除錯工作中,尤其在產線除錯時,常常會替換某個模組或者單編相關的image(如bootimg、包含模組的systemimg或vendorimg)。這時,很有可能會遇到一個問題:驅動載入失敗,列印log會看到“Required key not available”。 這是核心模組與驅動的簽名

Error: xz compression not available

在使用yum的時候遇到一個錯誤:Error: xz compression not available 我的環境是 centos7 yum -y update Error: xz compression not available. 經過一番查詢,總結一下解決方案。

internal error: SHA-1 not available.

在啟動tomct的時候,或者是使用SpringBoot啟動應用的時候,會出現internal error: SHA-1 not available.。這個錯誤: org.springframework.context.ApplicationContextException: Unable t

解決insmod: error inserting 'hello.ko': -1 Invalid module format

實現 功能:在PC的LINUX實現驅動測試,不用在2440上測試 解決insmod: error inserting ‘hello.ko’: -1 Invalid module format 第一次寫Linux驅動,環境搭建了好久,第一次可能是由於GCC的版本問

【已解決】ORA-01034: ORACLE not available ORA-27101

解決方法: 開啟命令列輸入資料庫的dba賬戶 sqlpuls sys/12345 as sysdba; 回車再輸入startup,回車.這步是啟動oracle服務。如果startup啟動被告知已經啟動

error registry key 'SoftwareJavaSoftJava Runtime Environment'CurrentVersion' has value 'XX',but 'XX' is required 解決辦法

文件 解決辦法 打開 java版本 ftw cli 忘記 sof version 這個錯誤很奇怪,很久之前出現過一次,已經忘記咋解決的了,今天特地記錄下。 我機器上java有3個版本,1.6,1.7,1.8,環境變量JAVA_HOME是一直配的1.8為主要。 因為我3個

The following signatures couldn't be verified because the public key is not available 解決方法

upd ack AD ase itl no_pubkey sig TP ubun 今天試圖把 deepin 的軟件源加到我到 Ubuntu 16.04 中去。 在 deepin wiki 上看到一個教程。 在 /etc/apt/sources.list 中加上 deepin

Error】 the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C

安裝了php第三方源後apt-get update遇到如下錯誤: $ sudo apt-get update -y Hit:1 http://downloads.metasploit.com/data/releases/metasploit-framework/apt lu

git:Git fetch和git pull的區別, 解決Git報錯:error: You have not concluded your merge (MERGE_HEAD exists).

pre ret mas -h ruby error you origin 分支 Git fetch和git pull的區別, 解決Git報錯:error: You have not concluded your merge (MERGE_HEAD exists). 解決

ORA-01034: ORACLE not available解決

process port ron style 監聽 all rom partition class 問題現象: alter user scott account unlock; ERROR at line 1:ORA-01034: ORACLE not availabl

The requested resource is not available解決辦法

localhost 們的 wid lib ava 路徑 available 方法 dex 以"HTTP Status 404(The requested resource is not available)"示例 HTTP Status 404(The re

解決php編譯報錯configure: error: mcrypt.h not found. Please reinstall libmcrypt.

clas fig ati libmcrypt conf data -s blog bmc yum install -y epel-releaseyum install -y libmcrypt-devel 解決php編譯報錯configure: error: m

xvfb-run: error: xauth command not found 解決方式

http com IT erro then and found cpp run http://tokanao.com/blog/2016/07/13/blog.html 錯誤提示 array(2) { [0]=> string(27) "which: no

Docker隨筆:Hyper-V PowerShell Module is not available報錯解決方法

eas 詳細 返回 create err 虛擬 releases mod doc 當在win10使用docker-machine創建Hyper-v虛擬機時,返回了一個錯誤”Error with pre-create check: "Hyper-V PowerShell Mo

npm install 報錯(npm ERR! errno -4048,Error: EPERM: operation not permitted,)解決方法

win npm support comm project 需要 event sin 命令 npm ERR! path E:\SouthernPowerGridProject\web_project\AutoOPS\autoops\node_modules\fsevents\

Paceman: required key missing from keyring 解決方案

先附上報錯資訊: (3/3) checking keys in keyring downloading required keys... error: key "A87A225CA0B4B1A4" could not be looked up remotely error: requ

【Vagrant】-NO.130.Vagrant.2 -【Error:the filesystem "vboxsf" is not available

Style:Mac Series:Java Since:2018-09-10 End:2018-09-10 Total Hours:1 Degree Of Diffculty:5 Degree Of Mastery:5 Practical Level:5 Desired Goal:5 Arc

Error: could not find java.dll 解決辦法 Error: could not find java.dll

Error: could not find java.dll 問題: 安裝配置Java環境變數後,在命令列中執行java -version進行測試時卻出現下面的問題: Error: opening registry key 'Software\JavaSoft\Java Runti