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
6.23k stars 2k forks source link

如果编译的时候添加驱动 #2614

Open LIUBANGJIAN opened 1 month ago

LIUBANGJIAN commented 1 month ago

大佬,你好。请问,如何在线编译的时候把驱动同时编译进去? 驱动地址https://github.com/hanwckf/hd2312

ophub commented 1 month ago

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

在内核编译时通过添加补丁的方式添加自定义驱动,编译固件时使用自定义内核。

LIUBANGJIAN commented 1 month ago

https://github.com/ophub/amlogic-s9xxx-armbian/blob/main/build-armbian/README.cn.md 大佬,我编译好了带自定义驱动的内核,我按说明文档,没找到编译固件要存放内核的kernel文件夹。我是使用 GitHub Actions 云编译,请问如何引用自定义的内核编译固件呢?

kousyougi commented 1 month ago

我想整合tcp-brutal https://github.com/apernet/tcp-brutal/ 查了好多資料,還是找不到方法。 希望有大神出整合教學。 謝謝

ophub commented 1 month ago

-r ophub/kernel -u stable 这两个参数是指定仓库和tags的,你指到自己的仓库名上

LIUBANGJIAN commented 3 weeks ago

好大佬,我先试试。大佬不要急着关闭iusses,谢谢。

LIUBANGJIAN commented 2 weeks ago

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

在内核编译时通过添加补丁的方式添加自定义驱动,编译固件时使用自定义内核。

大佬,我内核是编译成功 了,要怎么验证内核是集成了我上面要的驱动补丁呢?

ophub commented 2 weeks ago

你使用的内核源码仓库是你打了补丁的仓库,那就是使用了这个内核源码了。

LIUBANGJIAN commented 2 weeks ago

你使用的内核源码仓库是你打了补丁的仓库,那就是使用了这个内核源码了。

大佬,我没明白是什么意思。 我用我变化好的内核替换了设备现有的内核,发驱动没在里面,设备没驱动起来。

ophub commented 2 weeks ago

你打了补丁,修改config把你要的选项选择上,然后编译。

LIUBANGJIAN commented 2 weeks ago

你打了补丁,修改config把你要的选项选择上,然后编译。

我把DVB_HD231.patch放在kernel-patch和kernel-patch/beta/common-kernel-patches目录,然后编辑kernel-config/release/general/config-6.6文件

#
# Multiplexer drivers
#
# CONFIG_MUX_ADG792A is not set
# CONFIG_MUX_ADGS1408 is not set
CONFIG_MUX_GPIO=m
CONFIG_MUX_MMIO=m
CONFIT_DVB_HD2312=m ####这是我添加的,不知道这个名字是和patch文件名字一样就行。
# end of Multiplexer drivers

最后编译,然后编译错误,也没有标识什么地方错误。下面是最后一段错误日志

2024-11-05T12:11:12.0017870Z [ SUCCESS ] The [ dtb-allwinner-6.6.y-ophub.tar.gz ] file is packaged.
2024-11-05T12:11:12.4424307Z [ SUCCESS ] The [ dtb-amlogic-6.6.y-ophub.tar.gz ] file is packaged.
2024-11-05T12:11:13.2359794Z [ SUCCESS ] The [ dtb-rockchip-6.6.y-ophub.tar.gz ] file is packaged.
2024-11-05T12:11:13.2361194Z [ STEPS ] Packing the [ 6.6.y-ophub ] boot, modules and header packages...
2024-11-05T12:11:16.0223366Z [ SUCCESS ] The [ boot-6.6.y-ophub.tar.gz ] file is packaged.
2024-11-05T12:11:21.3505890Z [ SUCCESS ] The [ modules-6.6.y-ophub.tar.gz ] file is packaged.
2024-11-05T12:11:21.3522605Z [ SUCCESS ] The [ header-6.6.y-ophub.tar.gz ] file is packaged.
2024-11-05T12:11:21.7072936Z [ SUCCESS ] The [ sha256sums ] file has been generated
2024-11-05T12:11:24.3190709Z [ INFO ] Kernel series files are stored in [ /home/runner/work/_actions/ophub/amlogic-s9xxx-armbian/main/compile-kernel/output ].
2024-11-05T12:11:24.3191679Z [ STEPS ] Clear the space and update-grub...
2024-11-05T12:11:29.7273830Z [ SUCCESS ] All processes have been completed.
2024-11-05T12:11:29.7301530Z [ STEPS ] Server space usage after compilation: 
2024-11-05T12:11:29.7302391Z Filesystem                Type  Size  Used Avail Use% Mounted on
2024-11-05T12:11:29.7303067Z /dev/mapper/github-runner xfs   111G   13G   99G  12% /builder 
2024-11-05T12:11:29.7303458Z 
2024-11-05T12:11:29.7303698Z [ SUCCESS ] All process completed successfully.
2024-11-05T12:11:29.7439000Z ##[error]Process completed with exit code 1.
2024-11-05T12:11:29.7559975Z Post job cleanup.
2024-11-05T12:11:29.8604168Z [command]/usr/bin/git version
2024-11-05T12:11:29.8645668Z git version 2.47.0
2024-11-05T12:11:29.8693314Z Temporarily overriding HOME='/home/runner/work/_temp/8e3da11f-8025-4972-995c-8774e34214de' before making global git config changes
2024-11-05T12:11:29.8694431Z Adding repository directory to the temporary git global config as a safe directory
2024-11-05T12:11:29.8698538Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/kernel/kernel
2024-11-05T12:11:29.8737594Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2024-11-05T12:11:29.8769313Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2024-11-05T12:11:29.9062277Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2024-11-05T12:11:29.9087099Z http.https://github.com/.extraheader
2024-11-05T12:11:29.9098654Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2024-11-05T12:11:29.9137875Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2024-11-05T12:11:29.9593417Z Cleaning up orphan processes

请大佬指点一下,我上面的操作错在什么地方?

ophub commented 2 weeks ago

内核签名到这步应该是准确的版本号了,而不是y 内核选项不是猜,在本地自己的内核目录里make menuconfig启动选择面板,选择后保存,生成新的config,然后使用这个新的config进行编译。 内核的编译错误不只看结果错了,要往上翻找到错误的地方,多线程编译往往要多翻几屏才能看到错误。或者你下载日志本地搜

LIUBANGJIAN commented 2 weeks ago
行  2187: 2024-11-08T01:13:44.9377116Z '/home/runner/work/kernel/kernel/kernel-patch/beta/common-kernel-patches/HD2312.patch' -> 'compile-kernel/tools/patch/common-kernel-patches/HD2312.patch'
行  2238: 2024-11-08T01:16:45.1146265Z '/home/runner/work/_actions/ophub/amlogic-s9xxx-armbian/main/compile-kernel/tools/patch/common-kernel-patches/HD2312.patch' -> '/home/runner/work/_actions/ophub/amlogic-s9xxx-armbian/main/compile-kernel/kernel/linux-6.1.y/HD2312.patch'
行  2243: 2024-11-08T01:16:45.1169458Z [ INFO ] Apply kernel patch file: [ HD2312.patch ]
行 23205: 2024-11-08T02:16:36.1600078Z '/home/runner/work/_actions/ophub/amlogic-s9xxx-armbian/main/compile-kernel/tools/patch/common-kernel-patches/HD2312.patch' -> '/home/runner/work/_actions/ophub/amlogic-s9xxx-armbian/main/compile-kernel/kernel/linux-6.6.y/HD2312.patch'
行 23210: 2024-11-08T02:16:36.1624358Z [ INFO ] Apply kernel patch file: [ HD2312.patch ]

我看编译记录是有添加hd2312的补丁了,

LIUBANGJIAN commented 2 weeks ago

大佬,我发现添加补丁的方式要还添加hd2312-fe.chd2312.hhttps://github.com/hanwckf/hd2312/blob/main/hdic_hd2312.c这三个文件,是一并下载放到补丁目录了吗

ophub commented 2 weeks ago

你在本地先clone源码,然后添加这些文件,生成patch文件,使用这个文件。

LIUBANGJIAN commented 2 weeks ago

我已经git clone到本地,怎么添加这些文件生成patch呢?我看网上都是git diff这个做版本差异生成patch文件,生成的patch是0空间,请大佬指导一下。

ophub commented 2 weeks ago

https://github.com/unifreq/linux-6.1.y/commits/main/

git 提交后的commit就是,url后面加.patch 比如最新的这个提交: https://github.com/unifreq/linux-6.1.y/commit/5eb841b59d6ead6e264163785a634e78f0253c8e

他的patch就是上面的地址后面你加.patch回车就是了,把这个放在补丁目录即可。

这里有点说明: https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/compile-kernel

LIUBANGJIAN commented 2 weeks ago

https://github.com/unifreq/linux-6.1.y/commits/main/

git 提交后的commit就是,url后面加.patch 比如最新的这个提交: unifreq/linux-6.1.y@5eb841b

他的patch就是上面的地址后面你加.patch回车就是了,把这个放在补丁目录即可。

这里有点说明: https://github.com/ophub/amlogic-s9xxx-armbian/tree/main/compile-kernel

我前面就是这样做,这样生成的patch文件没有包括hd2312-fe.chd2312.h、 这个三个文件。

ophub commented 2 weeks ago

你放进去再提交生成补丁

LIUBANGJIAN commented 2 weeks ago

生成的补丁 https://github.com/hanwckf/hd2312/commit/543e3b81d775350331ce9aa085d1631d575c6d6a.patch 我已经将文件放到common-kernel-patches了,也修改了config文件,但是编译的内核的时候认识报错。 找不到啥原因。 报错日志 https://results-receiver.actions.githubusercontent.com/rest/runs/c9bbddd6-b0b0-44a1-bd5c-cee6200c9e9a/logs?filename=logs_30722924799.zip&signature=1731333520.15ac306e35e54ff0042198d379707d665ca8647b7cd75b01d09fd690bc9879a4

大佬麻烦再指点一下。

LIUBANGJIAN commented 1 week ago

你在本地先clone源码,然后添加这些文件,生成patch文件,使用这个文件。

大佬,我还是卡在这,怎么将整个库生成patch呢

ophub commented 1 week ago

你的git提交,就是一个commit,在这个url后面加个.patch这就是补丁,你一次修改了多少就自动生成多少。你可以一下都放在一个补丁里,也可以分开生成多个补丁。把补丁放在合适的目录即可使用。我感觉我的示例写的比较清楚了,为了说明我还特意放了几个补丁。

https://github.com/ophub/kernel/tree/main/kernel-patch/beta/linux-5.15.y