首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >驱动程序编译红帽

驱动程序编译红帽
EN

Stack Overflow用户
提问于 2009-06-25 09:13:36
回答 3查看 934关注 0票数 0

我对编译linux驱动程序非常陌生,我遇到了一些问题!

我正试图为usb设备编译一个驱动程序。

结果:

代码语言:javascript
复制
[thayoz@lacalpc13 linux]$ make
for i in driver lib qrng ; do cd $i && (make all || exit ) && cd ..; done
make[1]: Entering directory /home/thayoz/Desktop/untitled folder/Quantis-USB/src/linux/driver'
make -C /usr/src/kernels/ M=/home/thayoz/Desktop/untitled folder/Quantis-USB/src/linux/driver V=1 modules
make[2]: Entering directory/usr/src/kernels'
make[2]: * No rule to make target folder/Quantis-USB/src/linux/driver'.  Stop.
make[2]: Leaving directory/usr/src/kernels'
make[1]: * [all] Error 2
make[1]: Leaving directory `/home/thayoz/Desktop/untitled folder/Quantis-USB/src/linux/driver'
/bin/sh: line 0: cd: lib: No such file or directory
/bin/sh: line 0: cd: qrng: No such file or directory
make: *** [all] Error 1

我不知道怎么了?

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2009-08-11 20:29:01

典型的情况如下:

代码语言:javascript
复制
make -C <directory to kernel source> M=<directory to module/driver source> modules
make -C <directory to kernel source> M=<directory to module/driver source> modules_install

就够了。

你的司机带着马卡费来了吗?您是否正在针对适当的内核源代码进行编译,例如,正确的版本?

票数 0
EN

Stack Overflow用户

发布于 2009-08-11 20:22:06

我认为,构建目录路径中的空间可能导致了这个问题。

/home/thayoz/Desktop/untitled文件夹/Quantis.

注意“未命名文件夹”中的空格。

看起来make将模块目录作为:

/home/thayoz/Desktop/untitled

和:

文件夹/Quantis-USB/src/linux/驱动程序

作为额外的参数(可能是要构建的目标)被传递。

尝试重命名'/home/thayoz/Desktop/untitled文件夹‘到’/home/thayoz/Desktop/untled文件夹‘,看看会发生什么。

票数 1
EN

Stack Overflow用户

发布于 2009-06-25 09:35:03

我对使用GNU构建系统构建一段软件的一般过程的理解是:

  1. 运行.configure脚本。此脚本检查系统上的构建环境,确保所有所需的可执行文件、库等都可用,并创建一个工作的Makefile。
  2. 快跑吧。这使用在步骤1中生成的Makefile来构建二进制文件。
  3. 运行。这会将二进制文件安装到系统上的正确位置。

GNU构建系统

您运行了驱动程序包附带的.configure脚本吗?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1042809

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档