【问题标题】:linux/init.h not in usr/include/linux directroylinux/init.h 不在 usr/include/linux 目录中
【发布时间】: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 驱动程序开发的源代码和依赖项。到目前为止,谷歌并不是很有帮助。而且我厌倦了移动可能会或可能不会损坏我的系统的文件。

【问题讨论】:

    标签: linux driver


    【解决方案1】:

    首先撤消你所做的。

    然后,安装内核源代码。在根目录中是 README 文件,它描述了构建驱动程序的要求,并指向源代码树中包含的详细文档。 https://elixir.bootlin.com/linux/v3.10.108/source/README

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-04-10
      • 1970-01-01
      • 2015-01-17
      • 2014-10-19
      • 1970-01-01
      • 2023-01-17
      • 2020-12-07
      相关资源
      最近更新 更多