Linux:modprobe: ERROR: could not insert ‘tcrypt‘: Resource temporarily unavailable

问题背景

        加载内核算法自检模块tcrypt.ko时出现问题

root@localhost:/boot/modules/5.10.35-rt39-dirty/kernel/crypto# modprobe tcrypt                
modprobe: ERROR: could not insert 'tcrypt': Resource temporarily unavailable

        查看有该驱动:        

 

       在百度上没搜到这个问题,在谷歌上找到了一点线索,是因为tcrypt作为内核加密模块中的算法检测模块时,需要在menuconfig中设置允许算法自检。

步骤

查看使用的内核

$ uname -a

Linux root 5.4.0-104-generic #118-Ubuntu SMP Wed Mar 2 19:02:41 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

修改内核配置

vim /usr/src/linux-headers-5.4.0-104-generic/.config

修改为CONFIG_CRYPTO_TEST=m

修改文本菜单make menuconfig

        说明:未安装ncurses需要yum -y install ncurses-devel

Device Drivers  --->
Character devices --->
<*> Hardware Random Number Generator Core support     查看是否勾选

Cryptographic API --->
< * > Cryptographic algorithm manager
[ ] Disable run-time self tests
< M > Testing module
< * > Sequence Number IV Generator
*** Block modes ***
< * > CBC support
< * > CTR support
< * > ECB support
< * > HMAC support
< * > MD5 digest algorithm
< * > SHA1 digest algorithm
< * > SHA224 and SHA256 digest algorithm
< * > AES cipher algorithms
< * > DES and Triple DES EDE cipher algorithms

6.# [*] Hardware crypto devices --->     如有硬件算法加速需勾选相关选项
< > Support for Intel® C62X
[ ] Support for AMD Cryptographic Coprocessor

保存

        退出回到主配置屏幕,最后退出配置实用程序。当询问是否保存新配置时,请选择是。该实用程序将指示已写入.config的配置。

使用新配置重建内核

make -j8
make modules -j8 //内核模块编译
make modules_install //安装内核模块,将内核模块安装到相应的目录中。
make install //安装内核

probe

modprobe tcrypt mode=1000 //检查可用算法
modprobe tcrypt sec=2 mode=402 //异步md5测试速度,每个测试时长2s

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

技术探索者

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值