我按照此处的说明构建一个签名的内核 deb 包:https://paldan.altervista.org/signed-linux-kernel-deb-creation-how-to/?doing_wp_cron=1701813437.7412788867950439453125
它似乎构建了内核并构建和签名了模块。输出中有很多这样的内容:
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/6lowpan/nhc_fragment.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/6lowpan/nhc_hop.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/6lowpan/nhc_ipv6.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/6lowpan/nhc_mobility.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/6lowpan/nhc_routing.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/6lowpan/nhc_udp.ko
SIGN debian/linux-image/lib/modules/6.6.0-local/kernel/net/6lowpan/nhc_fragment.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/ieee802154/6lowpan/ieee802154_6lowpan.ko
SIGN debian/linux-image/lib/modules/6.6.0-local/kernel/net/6lowpan/nhc_hop.ko
SIGN debian/linux-image/lib/modules/6.6.0-local/kernel/net/6lowpan/nhc_ipv6.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/ieee802154/ieee802154.ko
SIGN debian/linux-image/lib/modules/6.6.0-local/kernel/net/6lowpan/nhc_mobility.ko
SIGN debian/linux-image/lib/modules/6.6.0-local/kernel/net/6lowpan/nhc_routing.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/ieee802154/ieee802154_socket.ko
SIGN debian/linux-image/lib/modules/6.6.0-local/kernel/net/6lowpan/nhc_udp.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/mac802154/mac802154.ko
SIGN debian/linux-image/lib/modules/6.6.0-local/kernel/net/ieee802154/6lowpan/ieee802154_6lowpan.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/ceph/libceph.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/batman-adv/batman-adv.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/nfc/nfc.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/nfc/nci/nci.ko
SIGN debian/linux-image/lib/modules/6.6.0-local/kernel/net/ieee802154/ieee802154_socket.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/nfc/nci/nci_spi.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/nfc/nci/nci_uart.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/nfc/hci/hci.ko
SIGN debian/linux-image/lib/modules/6.6.0-local/kernel/net/ieee802154/ieee802154.ko
INSTALL debian/linux-image/lib/modules/6.6.0-local/kernel/net/nfc/nfc_digital.ko
然后它会执行所谓的“ZSTD”操作 - 似乎正在压缩模块?有很多这样的操作:
ZSTD debian/linux-image/lib/modules/6.6.0-local/kernel/crypto/ansi_cprng.ko.zst
ZSTD debian/linux-image/lib/modules/6.6.0-local/kernel/crypto/tcrypt.ko.zst
ZSTD debian/linux-image/lib/modules/6.6.0-local/kernel/crypto/polyval-generic.ko.zst
ZSTD debian/linux-image/lib/modules/6.6.0-local/kernel/crypto/af_alg.ko.zst
ZSTD debian/linux-image/lib/modules/6.6.0-local/kernel/crypto/algif_hash.ko.zst
ZSTD debian/linux-image/lib/modules/6.6.0-local/kernel/crypto/algif_skcipher.ko.zst
ZSTD debian/linux-image/lib/modules/6.6.0-local/kernel/crypto/algif_rng.ko.zst
ZSTD debian/linux-image/lib/modules/6.6.0-local/kernel/crypto/algif_aead.ko.zst
ZSTD debian/linux-image/lib/modules/6.6.0-local/kernel/crypto/zstd.ko.zst
ZSTD debian/linux-image/lib/modules/6.6.0-local/kernel/crypto/ofb.ko.zst
ZSTD debian/linux-image/lib/modules/6.6.0-local/kernel/crypto/ecc.ko.zst
ZSTD debian/linux-image/lib/modules/6.6.0-local/kernel/crypto/essiv.ko.zst
ZSTD debian/linux-image/lib/modules/6.6.0-local/kernel/crypto/curve25519-generic.ko.zst
ZSTD debian/linux-image/lib/modules/6.6.0-local/kernel/crypto/ecdh_generic.ko.zst
ZSTD debian/linux-image/lib/modules/6.6.0-local/kernel/crypto/ecrdsa_generic.ko.zst
然后它尝试重新对模块进行签名但找不到它们:
DEPMOD debian/linux-image/lib/modules/6.6.0-local
INSTALL debian/linux-libc-dev/usr/include
SIGN debian/linux-image/lib/modules/6.6.0-local/kernel/arch/x86/events/amd/amd-uncore.ko
SIGN debian/linux-image/lib/modules/6.6.0-local/kernel/arch/x86/events/intel/intel-cstate.ko
SIGN debian/linux-image/lib/modules/6.6.0-local/kernel/arch/x86/events/rapl.ko
At main.c:298:
- SSL error:FFFFFFFF80000002:system library::No such file or directory: ../crypto/bio/bss_file.c:67
- SSL error:10000080:BIO routines::no such file: ../crypto/bio/bss_file.c:75
sign-file: debian/linux-image/lib/modules/6.6.0-local/kernel/arch/x86/events/amd/amd-uncore.ko
At main.c:298:
- SSL error:FFFFFFFF80000002:system library::No such file or directory: ../crypto/bio/bss_file.c:67
- SSL error:10000080:BIO routines::no such file: ../crypto/bio/bss_file.c:75
sign-file: debian/linux-image/lib/modules/6.6.0-local/kernel/arch/x86/events/intel/intel-cstate.ko
make[6]: *** [scripts/Makefile.modinst:137: debian/linux-image/lib/modules/6.6.0-local/kernel/arch/x86/events/amd/amd-uncore.ko] Error 1
make[6]: *** Waiting for unfinished jobs....
SIGN debian/linux-image/lib/modules/6.6.0-local/kernel/arch/x86/kernel/cpu/mce/mce-inject.ko
make[6]: *** [scripts/Makefile.modinst:137: debian/linux-image/lib/modules/6.6.0-local/kernel/arch/x86/events/intel/intel-cstate.ko] Error 1
At main.c:298:
- SSL error:FFFFFFFF80000002:system library::No such file or directory: ../crypto/bio/bss_file.c:67
- SSL error:10000080:BIO routines::no such file: ../crypto/bio/bss_file.c:75
sign-file: debian/linux-image/lib/modules/6.6.0-local/kernel/arch/x86/events/rapl.ko
At main.c:298:
- SSL error:FFFFFFFF80000002:system library::No such file or directory: ../crypto/bio/bss_file.c:67
- SSL error:10000080:BIO routines::no such file: ../crypto/bio/bss_file.c:75
sign-file: debian/linux-image/lib/modules/6.6.0-local/kernel/arch/x86/kernel/cpu/mce/mce-inject.ko
make[6]: *** [scripts/Makefile.modinst:137: debian/linux-image/lib/modules/6.6.0-local/kernel/arch/x86/events/rapl.ko] Error 1
make[6]: *** [scripts/Makefile.modinst:137: debian/linux-image/lib/modules/6.6.0-local/kernel/arch/x86/kernel/cpu/mce/mce-inject.ko] Error 1
make[5]: *** [Makefile:1821: modules_install] Error 2
make[4]: *** [Makefile:2036: run-command] Error 2
make[3]: *** [debian/rules:17: binary-arch] Error 2
dpkg-buildpackage: error: make -f debian/rules binary subprocess returned exit status 2
make[2]: *** [scripts/Makefile.package:146: deb-pkg] Error 2
make[1]: *** [/home/tkcook/git/linux/v6.6/Makefile:1538: deb-pkg] Error 2
make: *** [Makefile:234: __sub-make] Error 2
我觉得我肯定遗漏了一些基本的东西?我还需要做什么才能生成签名自定义内核的 deb 包?
答案1
由于某种原因,ZSTD 内核模块压缩会导致签名时出现这些错误。不确定这是否是一个错误。禁用 ZSTD 压缩可以解决这个问题。将以下内核配置选项更改为如下:
CONFIG_MODULE_COMPRESS_NONE=y
# CONFIG_MODULE_COMPRESS_ZSTD is not set
请参阅我的回答以了解更多详细信息:https://stackoverflow.com/questions/76587960/failed-to-install-kernel-modules/77671009#77671009