ophub / amlogic-s9xxx-armbian

Support for Armbian in Amlogic, Rockchip and Allwinner boxes. Support a311d, s922x, s905x3, s905x2, s912, s905d, s905x, s905w, s905, s905l, rk3588, rk3568, rk3399, rk3328, h6, etc.
GNU General Public License v2.0
5.69k stars 1.83k forks source link

请问如何编译wifi驱动,卡在kernel headersd 的安装 #548

Closed allonmymind closed 1 year ago

allonmymind commented 1 year ago

想尝试编译wifi驱动,安装kernel headers失败,查看过之前相关issue,表示看不太懂。。。 希望获得您的帮助,谢谢!

以下是找到的大致编译步骤: Compiling & Building Dependencies To compile the driver, you need to have make and a compiler installed. In addition, you must have the kernel headers installed. If you do not understand what this means, consult your distro.

Compiling make

Installing sudo make install

Disable CDROM mode and select in WiFi mode. (not for Ubuntu 20.04) eject /dev/cdrom0

ophub commented 1 year ago

headers己经安装了/usr/src

allonmymind commented 1 year ago

headers己经安装了

之前的issue里您说在/usr/local/include里, 可/usr/local/include里是空的,再就是您说要指定编译路径,请问参照上面的步骤,命令应该是怎样的,能指导下吗

ophub commented 1 year ago

你发的看不清,文字划个线有什么特殊意义?

allonmymind commented 1 year ago

你发的看不清,文字划个线有什么特殊意义?

粘贴上去的时候没有划线,发表后自己就带上了横线。 image 很少提issue,不懂这个原因,抱歉,我上传了截图

hgwfm commented 1 year ago

请您不要再给我错发邮件了

黄卫明的iPhone

在 2022年9月9日,13:35,ophub @.***> 写道:

 headers己经安装了

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

ophub commented 1 year ago

你看的教程不对。你在armbian里编译不用交叉工具链

这是完整编译的方法,单独编驱动可以参考armbian-kernel

https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/compile-kernel

allonmymind commented 1 year ago

你看的教程不对。你在armbian里编译不用交叉工具链

image 这张截图应该是官方的教程吧

allonmymind commented 1 year ago

你看的教程不对。你在armbian里编译不用交叉工具链

这是完整编译的方法,单独编驱动可以参考armbian-kernel

https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/compile-kernel

您发的这个链接没看到如何添加其他驱动的源码进去编译的方法,我没有这方面的基础,也许是我看不懂... 所以都是在网上找教程跟着做才行

ophub commented 1 year ago

你看的armbian教程对,第一步安装忽略。因为你安装不上,我们使用的是自定义名称的内核,官方安装的header对不上名称。

ls /usr/lib/modules/5.15.57-flippy-75+o/build -l

这就是header的路径,在/usr/src下

allonmymind commented 1 year ago

你看的armbian教程对,第一步安装忽略。因为你安装不上,我们使用的是自定义名称的内核,官方安装的header对不上名称。

image 我去路径/usr/src/linux-5.15.y看了下,这里有headers, make ARCH=arm CROSS_COMPILE= -C /lib/modules/5.15.57-flippy-75+o/build M=/root/build/rtl8188gu modules make[1]: Entering directory '/usr/src/linux-5.15.y' headers路径也正常找到了,但还是报错了

ophub commented 1 year ago

你执行的make命令不对,参数错误,这不是armbian下编译的参数

cat /etc/ophub-release

allonmymind commented 1 year ago

ls /usr/lib/modules/5.15.57-flippy-75+o/build -l

我之前编译python3.9就是这么编译的,没有问题的

ophub commented 1 year ago

你是什么设备?32位的?

allonmymind commented 1 year ago

你是什么设备?32位的?

image s905d2,64位的

ophub commented 1 year ago

你是给本机编译还是给其他设备编译? 用指定CROSS_COMPILE是要给其他设备交叉编译? ARCH="arm"是要编译给32位的设备使用吗?

如果是给s905d这个机器使用,你参照你上面发的armbian编译内核就可以,ARCH="arm64"

allonmymind commented 1 year ago

你是给本机编译还是给其他设备编译? 用指定CROSS_COMPILE是要给其他设备交叉编译? ARCH="arm"是要编译给32位的设备使用吗?

给本机编译用的,直接make编译是有提示ARCH=arm64,也是上面的报错结果,指定ARCH=arm,报错一样。 image 搜索了下有报错一样通过重新安装headers成功编译运行驱动的,您有试过这种方法编译其他驱动的经历吗,这个headers是不是确定可以用来编译驱动的呢

ophub commented 1 year ago

https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/compile-kernel/tools/script/armbian_compile_kernel_script.sh#L323

allonmymind commented 1 year ago

https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/compile-kernel/tools/script/armbian_compile_kernel_script.sh#L323

image 一样

ophub commented 1 year ago

Snip20220909_3

看看:ls /usr/src/

你报错里的/usr/src/linux-5.15.y路径是没有的,这个位置产生的文件夹,是你通过安装apt的header添加的吧?看看你modules里内核的build指向哪了,改到正确的位置

allonmymind commented 1 year ago

Snip20220909_2

ls /usr/src/

image 确实不一样 modules里内核的build指向哪了,改到正确的位置---这个有点不懂改0.0 我重新装一遍试试。

allonmymind commented 1 year ago

image 是这样的,是不是代表不用改?

ophub commented 1 year ago
armbian-sync
armbian-update

依次执行这2个命令,同步脚本,更新至最新内核,就修复了

allonmymind commented 1 year ago
armbian-sync
armbian-update

依次执行这2个命令,同步脚本,更新至最新内核,就修复了

image 重新安装还是不行。。。

ophub commented 1 year ago

header的路径对了,编译中根据错误自己调试,看你的源码哪行报错就去调试对应的文件。 这个错误说你源码文件里的路径找不到,正确的是:arch/arm64/Makefile

allonmymind commented 1 year ago

大佬你好,我用balbed150的5.9内核的固件试了能运行编译驱动,用你的5.10的内核固件一开始就报错,对比了下如下路径的文件夹好像不完整,能帮忙确定下问题是否出在这里吗? image image