驱动编译时,内核目录为空

驱动编译时,报错/lib/modules/3.10.0-862.ns7_4.019.mips64el/build: 没有那个文件或目录。 停止。

查看目录发现build指向的内核目录不存在。

解决方法:

Linux系统中默认不安装内核源码

我们需要自行安装

命令如下:

yum install kernel-devel -y

安装好之和即可

扩展:

有的朋友已经安装了该包,而/usr/src/kernels目录下仍为空

我们需要先用 yum remove kernel-devel 卸载,然后重新安装

安装时遇到问题如下:

[root@rocketmq-nameserver2 ~]# yum install kernel-devel -y

ns7-mips64el-os | 2.9 kB 00:00:00

http://mirror.li.nux.ro/li.nux.ro/nux/dextop/el7/mips64el/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

正在尝试其它镜像。

To address this issue please refer to the below knowledge base article

http://www.cs2c.com.cn

If above article doesn't help to resolve this issue please contact with CS2C Support.

http://li.nux.ro/download/nux/dextop/el7/mips64el/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

正在尝试其它镜像。

One of the configured repositories failed (Nux.Ro RPMs for general desktop use),

and yum doesn't have enough cached data to continue. At this point the only

safe thing yum can do is fail. There are a few ways to work "fix" this:

1. Contact the upstream for the repository and get them to fix the problem.

2. Reconfigure the baseurl/etc. for the repository, to point to a working

upstream. This is most often useful if you are using a newer

distribution release than is supported by the repository (and the

packages for the previous distribution release still work).

3. Run the command with the repository temporarily disabled

yum --disablerepo=nux-dextop ...

4. Disable the repository permanently, so yum won't use it by default. Yum

will then just ignore the repository until you permanently enable it

again or use --enablerepo for temporary usage:

yum-config-manager --disable nux-dextop

or

subscription-manager repos --disable=nux-dextop

5. Configure the failing repository to be skipped, if it is unavailable.

Note that yum will try to contact the repo. when it runs most commands,

so will have to try and fail each time (and thus. yum will be be much

slower). If it is a very temporary problem though, this is often a nice

compromise:

yum-config-manager --save --setopt=nux-dextop.skip_if_unavailable=true

failure: repodata/repomd.xml from nux-dextop: [Errno 256] No more mirrors to try.

http://mirror.li.nux.ro/li.nux.ro/nux/dextop/el7/mips64el/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

http://li.nux.ro/download/nux/dextop/el7/mips64el/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

解决方法:

/etc/yum.repos.d 有两个*.repo文件(ns7-mips.repo nux-dextop.repo),这两个repo文件,有一个文件里的链接是不可用的,把这个文件重命名。

重新执行yum install kernel-devel -y 指令,安装成功。

重新编译驱动:

/lib/modules/3.10.0-862.ns7_4.019.mips64el/build 软链接重新链接下载的内核:

最后编译驱动成功。

参考网址:

https://blog.youkuaiyun.com/qq_43479432/article/details/104742566

https://itnoteshare.com/course/25/503/previewcourse.htm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值