linux 编译内核时出现错误没有创建目标的规则'debian/certs/debian-uefi-certs.pem'

qni6mghb  于 2023-03-07  发布在  Linux
关注(0)|答案(3)|浏览(444)

编译内核时出现错误No rule to make target 'debian/certs/debian-uefi-certs.pem我正在学习本教程https://www.cyberciti.biz/tips/compiling-linux-kernel-26.html

CC      kernel/jump_label.o
CC      kernel/iomem.o
CC      kernel/rseq.o
AR      kernel/built-in.a
CC      certs/system_keyring.o
make[1]: *** No rule to make target 'debian/certs/debian-uefi-certs.pem', needed by 'certs/x509_certificate_list'.  Stop.
make: *** [Makefile:1851: certs] Error 2
eqzww0vc

eqzww0vc1#

我没有删除内核签名检查,而是正确地配置了它:

#
# Certificates for signature checking
#
CONFIG_MODULE_SIG_KEY="certs/signing_key.pem"
CONFIG_MODULE_SIG_KEY_TYPE_RSA=y
CONFIG_MODULE_SIG_KEY_TYPE_ECDSA=y
CONFIG_SYSTEM_TRUSTED_KEYRING=y
CONFIG_SYSTEM_TRUSTED_KEYS="/usr/local/src/debian/canonical-certs.pem"
CONFIG_SYSTEM_EXTRA_CERTIFICATE=y
CONFIG_SYSTEM_EXTRA_CERTIFICATE_SIZE=4096
CONFIG_SECONDARY_TRUSTED_KEYRING=y
CONFIG_SYSTEM_BLACKLIST_KEYRING=y
CONFIG_SYSTEM_BLACKLIST_HASH_LIST=""
CONFIG_SYSTEM_REVOCATION_LIST=y
CONFIG_SYSTEM_REVOCATION_KEYS="/usr/local/src/debian/canonical-revoked-certs.pem"
# end of Certificates for signature checking

为了达到这个目标,我遵循了以下步骤:

sudo mkdir -p /usr/local/src/debian
sudo apt install linux-source
sudo cp -v /usr/src/linux-source-*/debian/canonical-*.pem /usr/local/src/debian/
sudo apt purge linux-source*

...其中:
1.安装Ubuntu Linux内核源代码
1.将证书复制到专用的非软件包管理目录中
1.再次删除所有内核源代码软件包
每当需要更新(例如新证书)时,可以重复该过程。

cwtwac6a

cwtwac6a2#

这似乎是当前版本的做法:
https://unix.stackexchange.com/a/649484/301245
现在有很多很多的配置标志,并且签名系统必须保持可操作以使构建工作。最简单的是将debian/和debian.master/复制到要构建的内核的源代码树中,然后它就可以工作而不需要额外的修改。对密钥文件的引用可能仍然存在。.conf文件中的keys部分应如下所示:

#
# Certificates for signature checking
#
CONFIG_MODULE_SIG_KEY="certs/signing_key.pem"
CONFIG_SYSTEM_TRUSTED_KEYRING=y
CONFIG_SYSTEM_TRUSTED_KEYS=""
CONFIG_SYSTEM_EXTRA_CERTIFICATE=y
CONFIG_SYSTEM_EXTRA_CERTIFICATE_SIZE=4096
CONFIG_SECONDARY_TRUSTED_KEYRING=y
CONFIG_SYSTEM_BLACKLIST_KEYRING=y
CONFIG_SYSTEM_BLACKLIST_HASH_LIST=""
CONFIG_SYSTEM_REVOCATION_LIST=y
CONFIG_SYSTEM_REVOCATION_KEYS=""
# end of Certificates for signature checking
lh80um4z

lh80um4z3#

在内核源代码树的顶层目录中运行ln -s /usr/src/linux-source-x.y.z/debian debian,用合适的内核版本替换x.y.z

相关问题