centos6.5编译内核key.h: No such file or directory

crypto/signature/ksign-publickey.c:2:17: error: key.h: No such file or directory
crypto/signature/ksign-publickey.c: In function ‘ksign_init’:
crypto/signature/ksign-publickey.c:10: error: ‘ksign_def_public_key’ undeclared (first use in this function)
crypto/signature/ksign-publickey.c:10: error: (Each undeclared identifier is reported only once
crypto/signature/ksign-publickey.c:10: error: for each function it appears in.)
crypto/signature/ksign-publickey.c:11: error: ‘ksign_def_public_key_size’ undeclared (first use in this function)
make[2]: *** [crypto/signature/ksign-publickey.o] Error 1
make[1]: *** [crypto/signature] Error 2
make: *** [crypto] Error 2

解决方案:

Documentation/module-signing.txt

1.产生更过的随机数据:rngd -r /dev/urandom
2.生成genkey文件,展示了生成key的规则

%pubring kernel.pub
%secring kernel.sec
Key-Type: DSA
Key-Length: 1024
Name-Real: Red Hat, Inc.
Name-Comment: Kernel Module GPG key
%commit

3.生成bin2c程序,将二进制程序转化成c头文件表示

scripts/bin2c //gcc不识别 -m elf_x86_64,手动编译:gcc scripts/bin2c.c   -o scripts/bin2c
gcc   -m elf_x86_64  scripts/bin2c.c   -o scripts/bin2c
cc1: error: unrecognized command line option "-m"

4.生成key.h

gpg --homedir . --batch --gen-key genkey
gpg --homedir . --export --keyring kernel.pub keyname |scripts/bin2c ksign_def_public_key __initdata >crypto/signature/key.h
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值