【发布时间】:2021-06-15 19:16:16
【问题描述】:
当试图包含linux/init.h 时,我的编辑器告诉我这个文件不存在。对如何解决这个问题做了一些研究,我发现/usr/src 有一些,我假设内核版本,当我looked up on how to install header files for linux drivers development 时。我所做的是将linux-headers-5.10.0-kali4-common 中的一堆文件夹移动到/usr/include 和/usr/lib/module/5.10.0-kali4-amd64/source。
有一段时间我认为它有效,但给了我一个新错误cannot open source file "asm/rwonce.h" (dependency of "linux/init.h") 和cannot open source file "asm/linkage.h" (dependency of "linux/module.h")。此时我很沮丧。关闭一切,现在我在这里。
现在我想知道是否有更好的方法来获取我需要的 linux 驱动程序开发的源代码和依赖项。到目前为止,谷歌并不是很有帮助。而且我厌倦了移动可能会或可能不会损坏我的系统的文件。
【问题讨论】: